out=do_shell_c("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end end",0)
out.stdout.must_include'1 successful'
out.stdout.must_include'0 failures'
end
it'runs controls with multiple tests (json output)'do
out=do_shell_c("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end; describe file(\"foo/bar/baz\") do it { should exist } end end",1,true)
out=do_shell_c("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end; describe file(\"foo/bar/baz\") do it { should exist } end end",1)
out=do_shell('x = [1,2,3].inject(0) {|a,v| a + v*v}; x+10')
out.stdout.must_include"24"
end
it'runs anonymous tests that succeed'do
out=do_shell("describe file(\"#{__FILE__}\") do it { should exist } end")
out.stdout.must_include'1 successful'
out.stdout.must_include'0 failures'
end
it'runs anonymous tests that fail'do
out=do_shell("describe file(\"foo/bar/baz\") do it { should exist } end")
out.stdout.must_include'0 successful'
out.stdout.must_include'1 failures'
end
it'runs controls with tests'do
out=do_shell("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end end")
out.stdout.must_include'1 successful'
out.stdout.must_include'0 failures'
end
it'runs controls with multiple tests'do
out=do_shell("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end; describe file(\"foo/bar/baz\") do it { should exist } end end")
out=do_shell("control \"test\" do describe file(\"#{__FILE__}\") do it { should exist } end end\ncontrol \"test\" do describe file(\"foo/bar/baz\") do it { should exist } end end")