Sha256: d59fe65bc50cc969591a4825f0a5664f8a3db58709952df2029c12e1b3e891c6

Contents?: true

Size: 664 Bytes

Versions: 4

Compression:

Stored size: 664 Bytes

Contents

module StubOS
  def on_windows!
    stub_os('mswin')
    allow(Terrapin::OS).to receive(:path_separator).and_return(";")
  end

  def on_unix!
    stub_os('darwin11.0.0')
    allow(Terrapin::OS).to receive(:path_separator).and_return(":")
  end

  def on_mingw!
    stub_os('mingw')
    allow(Terrapin::OS).to receive(:path_separator).and_return(";")
  end

  def on_java!
    allow(Terrapin::OS).to receive(:arch).and_return("universal-java1.7")
  end

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

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/terrapin-1.0.1/spec/support/stub_os.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/terrapin-1.0.1/spec/support/stub_os.rb
terrapin-1.0.1 spec/support/stub_os.rb
terrapin-1.0.0 spec/support/stub_os.rb