Sha256: cb69344052f204405b9ced234512c57b08ff7b608026bd4dd4655992104ecc58
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 KB
Contents
require 'spec_helper' describe Launchy::Application::Browser do before do Launchy.reset_global_options ENV['KDE_FULL_SESSION'] = "launchy" @test_url = "http://example.com/" end after do Launchy.reset_global_options ENV.delete( 'KDE_FULL_SESSION' ) end { 'windows' => 'start /b' , 'darwin' => '/usr/bin/open', 'cygwin' => 'cmd /C start /b', # when running these tests on a linux box, this test will fail 'linux' => nil }.each do |host_os, cmdline| it "when host_os is '#{host_os}' the appropriate 'app_list' method is called" do Launchy.host_os = host_os browser = Launchy::Application::Browser.new browser.app_list.first.must_equal cmdline end end %w[ linux windows darwin cygwin ].each do |host_os| it "the BROWSER environment variable overrides any host defaults on '#{host_os}'" do ENV['BROWSER'] = "my_special_browser --new-tab '%s'" Launchy.host_os = host_os browser = Launchy::Application::Browser.new cmd, args = browser.cmd_and_args( @test_url ) cmd.must_equal "my_special_browser --new-tab 'http://example.com/'" args.must_equal [] end end it "handles a file on the file system when there is no file:// scheme" do uri = Addressable::URI.parse( __FILE__ ) Launchy::Application::Browser.handles?( uri ).must_equal true end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
launchy-2.0.4-java | spec/applications/browser_spec.rb |
launchy-2.0.4 | spec/applications/browser_spec.rb |