From c81b4c0c458cee89f81b2c5083c8155c8b2ca9db Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Tue, 12 May 2009 16:04:57 +0000 Subject: [PATCH] modified tests to work on both Windows and Linux. --- t/01-simple.rb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/t/01-simple.rb b/t/01-simple.rb index 4749776..3d91c52 100644 --- a/t/01-simple.rb +++ b/t/01-simple.rb @@ -1,6 +1,8 @@ #----------------------------------- # try to run non-existing command +# +# REQUIRE: RUBY_PLATFORM !~ /mswin32/ cmd "non-existing" do exit_nonzero @@ -11,8 +13,27 @@ end # ### non-existing # stdout end +#----------------------------------- +# try to run non-existing command +# +# REQUIRE: RUBY_PLATFORM =~ /mswin32/ + +cmd "non-existing" do + exit_nonzero + stderr_equal [ + /non-existing.*not recognized/, + /program or batch file/, + ] +end + +# stdout begin +# ### non-existing +# stdout end + #----------------------------------- # FAILING try to run non-existing command +# +# REQUIRE: RUBY_PLATFORM !~ /mswin32/ cmd "non-existing" do end @@ -25,6 +46,23 @@ end # --- expect: [[empty]] # stdout end +#----------------------------------- +# FAILING try to run non-existing command +# +# REQUIRE: RUBY_PLATFORM =~ /mswin32/ + +cmd "non-existing" do +end + +# stdout begin +# ### non-existing +# --- ERROR: expected zero exit status, got 1 +# --- ERROR: wrong stderr +#/--- actual:.*non-existing.*not recognized +#/--- .*program or batch file +# --- expect: [[empty]] +# stdout end + #----------------------------------- # "true.rb" is archetypic command: zero exit status, no output