From ae8ae224f526cc23d17ae7b9b0b6f21844f34ca2 Mon Sep 17 00:00:00 2001 From: Gabe Berke-Williams Date: Fri, 3 Feb 2012 17:09:38 -0500 Subject: [PATCH] Let's abstract that away again. --- spec/cocaine/command_line_spec.rb | 2 +- spec/support/stub_os.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/cocaine/command_line_spec.rb b/spec/cocaine/command_line_spec.rb index 27f823b..ab1aa37 100644 --- a/spec/cocaine/command_line_spec.rb +++ b/spec/cocaine/command_line_spec.rb @@ -152,7 +152,7 @@ end it "detects that the system is windows (mingw)" do - stub_os("mingw") + on_mingw! Cocaine::CommandLine.unix?.should be_false end diff --git a/spec/support/stub_os.rb b/spec/support/stub_os.rb index 3a7ef4d..4d43c35 100644 --- a/spec/support/stub_os.rb +++ b/spec/support/stub_os.rb @@ -7,6 +7,10 @@ def on_unix! stub_os('darwin11.0.0') end + def on_mingw! + stub_os('mingw') + 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)