spec/reek/cli/help_command_spec.rb in reek-1.3.8 vs spec/reek/cli/help_command_spec.rb in reek-1.4.0
- old
+ new
@@ -3,21 +3,23 @@
include Reek::Cli
describe HelpCommand do
before :each do
- @text = 'Piece of interesting text'
- @cmd = HelpCommand.new(@text)
+ @help_text = 'Piece of interesting text'
+ @parser = double('parser')
+ allow(@parser).to receive(:help_text).and_return @help_text
+ @cmd = HelpCommand.new(@parser)
@view = double('view').as_null_object
- @view.should_not_receive(:report_smells)
end
it 'displays the correct text on the view' do
- @view.should_receive(:output).with(@text)
+ expect(@view).to receive(:output).with(@help_text)
@cmd.execute(@view)
end
it 'tells the view it succeeded' do
- @view.should_receive(:report_success)
+ expect(@view).not_to receive(:report_smells)
+ expect(@view).to receive(:report_success)
@cmd.execute(@view)
end
end