cmdtest/t/00-stderr_equal.rb
Johan Holmberg 2c61efb00d add tests
2009-03-24 08:43:47 +00:00

105 lines
1.9 KiB
Ruby

#======================================================================
# test stderr_equal
#-----------------------------------
# stderr_equal -- correct ""
cmd "true.rb" do
stderr_equal ""
end
# stdout begin
# ### true.rb
# stdout end
#-----------------------------------
# stderr_equal -- incorrect ""
cmd "echo.rb hello world >&2" do
stderr_equal ""
end
# stdout begin
# ### echo.rb hello world >&2
# --- ERROR: wrong stderr
# --- actual: hello world
# --- expect: [[empty]]
# stdout end
#-----------------------------------
# stderr_equal -- correct []
cmd "true.rb" do
stderr_equal []
end
# stdout begin
# ### true.rb
# stdout end
#-----------------------------------
# stderr_equal -- incorrect []
cmd "echo.rb hello world >&2" do
stderr_equal []
end
# stdout begin
# ### echo.rb hello world >&2
# --- ERROR: wrong stderr
# --- actual: hello world
# --- expect: [[empty]]
# stdout end
#-----------------------------------
# stderr_equal -- correct [ "hello world" ]
cmd "echo.rb hello world >&2" do
stderr_equal [ "hello world" ]
end
# stdout begin
# ### echo.rb hello world >&2
# stdout end
#-----------------------------------
# stderr_equal -- incorrect [ "hello world" ]
cmd "true.rb" do
stderr_equal [ "hello world" ]
end
# stdout begin
# ### true.rb
# --- ERROR: wrong stderr
# --- actual: [[empty]]
# --- expect: hello world
# stdout end
#-----------------------------------
# stderr_equal -- correct [ "hello", "world" ]
cmd "echo.rb hello >&2 && echo.rb world >&2" do
stderr_equal [ "hello", "world" ]
end
# stdout begin
# ### echo.rb hello >&2 && echo.rb world >&2
# stdout end
#-----------------------------------
# stderr_equal -- incorrect [ "hello", "world" ]
cmd "true.rb" do
stderr_equal [ "hello", "world" ]
end
# stdout begin
# ### true.rb
# --- ERROR: wrong stderr
# --- actual: [[empty]]
# --- expect: hello
# --- world
# stdout end