test/bin_runner_test.rb in boson-1.1.1 vs test/bin_runner_test.rb in boson-1.2.0

- old
+ new

@@ -6,15 +6,11 @@ def aborts_with(regex) BinRunner.expects(:abort).with {|e| e[regex] } yield end - unless ENV['FAST'] || - # disable rubinius until Open3.spawn defined in Bahia - # disable jruby until Open3.spawn works with ENV in Bahia - RUBY_DESCRIPTION.include?('rubinius') || RUBY_PLATFORM[/java/] - + unless ENV['FAST'] it "prints usage with no arguments" do boson stdout.should =~ /^boson/ end @@ -42,11 +38,10 @@ boson "#{option} -e 'print $DEBUG'" stdout.should == 'true' end end - # TODO: test actual uses of Runner.debug it "sets Boson.debug with --debug" do boson "--debug -e 'print Boson.debug'" stdout.should == 'true' end @@ -58,23 +53,22 @@ end it "prints error for unexpected error" do boson %[-e 'raise "blarg"'] stderr.chomp.should == "Error: blarg" - process.success?.should == false end - # TODO: enable once bin runner's fate is decided - xit "prints error for too many arguments" do - boson "commands 1 2 3" - stderr.should =~ /^'commands' was called incorrectly/ - process.success?.should == false + it "prints error for too many arguments" do + with_command('dude') do + boson "dude 1 2 3" + stderr.should =~ /^'dude' was called incorrectly/ + process.success?.should == false + end end - # TODO: possible error with persistance extraction - xit "prints error for invalid command" do + it "prints error for invalid command" do boson 'blarg' - stderr.chomp.should == "Error: Command 'blarg' not found" + stderr.chomp.should == %[Could not find command "blarg"] process.success?.should == false end end it ".parse_args only translates options before command" do