test/scientist_test.rb in boson-0.0.1 vs test/scientist_test.rb in boson-0.1.0

- old
+ new

@@ -65,11 +65,11 @@ test "translate arg and stringified options" do args_are_equal [:cool, '-l3'], [:cool, {:level=>3}] end test "translate arg and normal hash options" do - args_are_equal [:cool, {:ok=>true}], [:cool, {:ok=>true}] + args_are_equal [:cool, {:ok=>true}], [:cool, {:ok=>true, :level=>2}] end test "translate stringified arg without options sets default options" do args_are_equal ['cool'], ['cool', {:level=>2}] end @@ -134,11 +134,11 @@ Scientist.expects(:render?).raises("unexpected") capture_stderr { command_with_args('a1') }.should =~ /Error.*unexpected/ end test "with no argument defined for options" do - capture_stderr { command({:args=>1}, 'ok') }.should =~ /misaligned/ + assert_error(ArgumentError, '2 for 1') { command({:args=>1}, 'ok') } end end test "translates stringfied args + options starting at second arg" do command_with_arg_defaults(1, 'nada -l3').should == [1, "nada", {:level=>3}] @@ -171,14 +171,15 @@ assert_error(*args) { command_with_arg_size } assert_error(*args) { command_with_arg_size '' } end test "with too many args raises ArgumentError" do - args = [ArgumentError, '3 for 2'] - assert_error(*args) { command_with_args 1,2,3 } - assert_error(*args) { command_with_args '1 2 3' } - assert_error(*args) { command_with_arg_size 1,2,3 } - assert_error(*args) { command_with_arg_size '1 2 3' } + args3 = [ArgumentError, '3 for 2'] + args4 = [ArgumentError, '4 for 2'] + assert_error(*args3) { command_with_args 1,2,3 } + assert_error(*args4) { command_with_args '1 2 3' } + assert_error(*args3) { command_with_arg_size 1,2,3 } + assert_error(*args4) { command_with_arg_size '1 2 3' } end end def command_with_render(*args) basic_command({:render_options=>{:fields=>{:values=>['f1', 'f2']}} }, args)