File: host_os_spec.rb

package info (click to toggle)
ruby-launchy 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: ruby: 1,285; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'spec_helper'

describe Launchy::Detect::HostOs do

  it "uses the defult host os from ruby's config" do
    _(Launchy::Detect::HostOs.new.host_os).must_equal RbConfig::CONFIG['host_os']
  end

  it "uses the passed in value as the host os" do
    _(Launchy::Detect::HostOs.new( "fake-os-1").host_os).must_equal "fake-os-1"
  end

  it "uses the environment variable LAUNCHY_HOST_OS to override ruby's config" do
    ENV['LAUNCHY_HOST_OS'] = "fake-os-2"
    _(Launchy::Detect::HostOs.new.host_os).must_equal "fake-os-2"
    ENV.delete('LAUNCHY_HOST_OS')
  end

end