File: osx_spec.rb

package info (click to toggle)
ruby-os 1.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 136 kB
  • sloc: ruby: 474; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (4)
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
29
30
require File.expand_path('spec_helper.rb', File.dirname(__FILE__))

describe 'For OSX (Snow Leopard, 10.6),' do
  before(:each) do
    ENV.stub!(:[]).with('OS').and_return(nil)
    # Issues stubbing RUBY_PLATFORM, using RbConfig instead.
    # Kernel.stub!(:RUBY_PLATFORM => "x86_64-darwin10.6")
    RbConfig::CONFIG.stub!(:[]).with('host_os').and_return("darwin10.6.0")
    RbConfig::CONFIG.stub!(:[]).with('host_cpu').and_return('i386')
  end

  describe OS do
    subject { OS } # class, not instance

    it { should be_mac }
    it { should be_x } # OS.x?
    it { should be_osx }
    it { should be_posix }

    it { should_not be_windows }

  end

  describe OS::Underlying do
    subject { OS::Underlying } # class, not instance

    it { should be_bsd }
    it { should_not be_windows }
  end
end