Sha256: 1439f859b1e979fcf7b8799a8df906b1cd9d7d9f068d56fee299f30160bd4a0c

Contents?: true

Size: 589 Bytes

Versions: 2

Compression:

Stored size: 589 Bytes

Contents

module StubOS
  def on_windows!
    stub_os('mswin')
    Terrapin::OS.stubs(:path_separator).returns(";")
  end

  def on_unix!
    stub_os('darwin11.0.0')
    Terrapin::OS.stubs(:path_separator).returns(":")
  end

  def on_mingw!
    stub_os('mingw')
    Terrapin::OS.stubs(:path_separator).returns(";")
  end

  def on_java!
    Terrapin::OS.stubs(:arch).returns("universal-java1.7")
  end

  def stub_os(host_string)
    # http://blog.emptyway.com/2009/11/03/proper-way-to-detect-windows-platform-in-ruby/
    RbConfig::CONFIG.stubs(:[]).with('host_os').returns(host_string)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
terrapin-0.6.0 spec/support/stub_os.rb
terrapin-0.6.0.alpha spec/support/stub_os.rb