File: nix_desktop_environment_spec.rb

package info (click to toggle)
ruby-launchy 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 304 kB
  • sloc: ruby: 1,051; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 851 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

require "spec_helper"

describe Launchy::Detect::NixDesktopEnvironment do
  before do
    Launchy.reset_global_options
  end

  after do
    Launchy.reset_global_options
  end

  it "returns false for XFCE if xprop is not found" do
    Launchy.host_os = "linux"
    _(Launchy::Detect::NixDesktopEnvironment::Xfce.is_current_desktop_environment?).must_equal(false)
  end

  it "returns NotFound if it cannot determine the *nix desktop environment" do
    Launchy.host_os = "linux"
    ENV.delete("KDE_FULL_SESSION")
    ENV.delete("GNOME_DESKTOP_SESSION_ID")
    Launchy.path = %w[/ /tmp].join(File::PATH_SEPARATOR)
    not_found = Launchy::Detect::NixDesktopEnvironment.detect
    _(not_found).must_equal(Launchy::Detect::NixDesktopEnvironment::NotFound)
    _(not_found.browser).must_equal(Launchy::Argv.new)
  end
end