Sha256: 601ade7562d27d394b96149c759804aeaf18c98634e90230b7dbfcf9813ad241

Contents?: true

Size: 1.15 KB

Versions: 24

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Launchy::Detect::NixDesktopEnvironment do

  before do
    Launchy.reset_global_options
  end

  after do
    Launchy.reset_global_options
  end

  it "can detect the desktop environment of a KDE machine using ENV['KDE_FULL_SESSION']" do
    ENV.delete( "KDE_FULL_SESSION" )
    ENV["KDE_FULL_SESSION"] = "launchy-test"
    kde = Launchy::Detect::NixDesktopEnvironment::Kde
    nix_env = Launchy::Detect::NixDesktopEnvironment.detect
    nix_env.must_equal( kde )
    nix_env.browser.must_equal( kde.browser )
    ENV.delete( 'KDE_FULL_SESSION' )
  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" )
    not_found = Launchy::Detect::NixDesktopEnvironment.detect
    not_found.must_equal( Launchy::Detect::NixDesktopEnvironment::NotFound )
    not_found.browser.must_equal( Launchy::Argv.new )
  end
end

Version data entries

24 entries across 21 versions & 4 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.1.0 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
cocoapods-dependency-html-0.0.2 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
cocoapods-dependency-html-0.0.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.13 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.12.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.11 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.9 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.8 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.7 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.6 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.5 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.4 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.2 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
tdiary-5.0.1 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/launchy-2.4.3/spec/detect/nix_desktop_environment_spec.rb