Sha256: a4b5f492f15380b8bb537c6d81148f25950483d2c19cf601a1b29fbf9953a5da

Contents?: true

Size: 897 Bytes

Versions: 17

Compression:

Stored size: 897 Bytes

Contents

require 'spec_helper'

module Maid
  describe Platform do
    def stub_host_os(value)
      RbConfig::CONFIG.stub(:[]).with('host_os') { value }
    end

    describe 'determining the host OS' do
      it 'delegates to RbConfig' do
        stub_host_os('foo')
        subject.host_os.should == 'foo'
      end
    end

    context 'when running on Ubuntu' do
      before do
        stub_host_os('linux-gnu')
      end

      it 'is identified as Linux' do
        subject.linux?.should be_true
      end

      it 'is not identified as OS X' do
        subject.osx?.should be_false
      end
    end

    context 'when running on Mac OS X' do
      before do
        stub_host_os('darwin10.0')
      end

      it 'is not identified as Linux' do
        subject.linux?.should be_false
      end

      it 'is identified as OS X' do
        subject.osx?.should be_true
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
maid-0.3.0 spec/lib/maid/platform_spec.rb
maid-0.3.0.beta.1 spec/lib/maid/platform_spec.rb
maid-0.2.2 spec/lib/maid/platform_spec.rb
maid-0.2.2.beta.1 spec/lib/maid/platform_spec.rb
maid-0.2.1 spec/lib/maid/platform_spec.rb
maid-0.2.0 spec/lib/maid/platform_spec.rb
maid-0.2.0.rc.2 spec/lib/maid/platform_spec.rb
maid-0.2.0.rc.1 spec/lib/maid/platform_spec.rb
maid-0.2.0.beta.3 spec/lib/maid/platform_spec.rb
maid-0.2.0.beta.2 spec/lib/maid/platform_spec.rb
maid-0.2.0.beta.1 spec/lib/maid/platform_spec.rb
maid-0.2.0.alpha.1 spec/lib/maid/platform_spec.rb
maid-0.1.4.alpha.2 spec/lib/maid/platform_spec.rb
maid-0.1.4.alpha.1 spec/lib/maid/platform_spec.rb
maid-0.1.3 spec/lib/maid/platform_spec.rb
maid-0.1.3.beta.2 spec/lib/maid/platform_spec.rb
maid-0.1.3.beta.1 spec/lib/maid/platform_spec.rb