test/utils_test.rb in kicker-2.2.3 vs test/utils_test.rb in kicker-2.3.0

- old
+ new

@@ -1,8 +1,12 @@ require File.expand_path('../test_helper', __FILE__) -Kicker::Utils.send(:public, :did_execute_command) +class Kicker + module Utils + public :will_execute_command, :did_execute_command + end +end describe "A Kicker instance, concerning its utility methods" do before do utils.stubs(:puts) end @@ -91,19 +95,30 @@ status.result("line 1\nline 2", false, 123) utils.did_execute_command(status) end + it "should clear the console before running a command" do + Kicker.clear_console = true + utils.expects(:puts).with("\e[H\e[2J") + + Kicker::Growl.stubs(:change_occured) + status = Kicker::LogStatusHelper.new(nil, 'ls -l') + status.result("line 1\nline 2", false, 123) + + utils.will_execute_command(status) + end + it "should store the last executed command" do Kicker::Growl.use = false utils.stubs(:log) utils.execute('date') utils.last_command.should == 'date' end - it "should call the block given to execute when and yield the log status helper with status success" do + it "should call the block given to execute and yield the log status helper with status success" do Kicker.silent = true Kicker::Growl.use = false utils.stubs(:last_command_succeeded?).returns(true) utils.expects(:log).with('Start!') @@ -120,11 +135,11 @@ 'Start!' end end end - it "should call the block given to execute when and yield the log status helper with status failed" do + it "should call the block given to execute and yield the log status helper with status failed" do Kicker.silent = true Kicker::Growl.use = false utils.stubs(:last_command_succeeded?).returns(false) utils.expects(:log).with('Start!') @@ -173,6 +188,6 @@ private def utils Kicker::Utils end -end \ No newline at end of file +end