From 71a74c00ef1b38c3a7c12374acc9d320b39c84ea Mon Sep 17 00:00:00 2001 From: Johan Holmberg <holmberg556@gmail.com> Date: Fri, 2 Oct 2015 22:27:07 +0200 Subject: [PATCH] add CMDTEST file verifying doc example --- doc/CMDTEST_example.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/CMDTEST_example.rb diff --git a/doc/CMDTEST_example.rb b/doc/CMDTEST_example.rb new file mode 100644 index 0000000..22cb30f --- /dev/null +++ b/doc/CMDTEST_example.rb @@ -0,0 +1,20 @@ +class CMDTEST_example < Cmdtest::Testcase + + def test_hello_world + cmd "echo hello" do + stdout_equal "hello\n" + end + + cmd "echo WORLD" do + stdout_equal "world\n" + end + end + + def test_touch_and_exit + cmd "touch bar.txt ; exit 8" do + created_files "foo.txt" + exit_status 7 + end + end + +end