Sha256: d4f0afbb6d716e35af8a63b7fad524e40eff7b4c2c39ea416ef2bc9f28fbc704
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' require 'reek/cli/reek_command' require 'reek/cli/report' require 'reek/examiner' include Reek include Reek::Cli describe ReekCommand do before :each do @view = double('view').as_null_object end context 'with smells' do before :each do examiner = Examiner.new('def x(); end') @cmd = ReekCommand.new(QuietReport.new, ['def x(); end']) end it 'displays the correct text on the view' do @view.should_receive(:output).with(/UncommunicativeMethodName/) @cmd.execute(@view) end it 'tells the view it succeeded' do @view.should_receive(:report_smells) @cmd.execute(@view) end end context 'with no smells' do before :each do @cmd = ReekCommand.new(QuietReport.new, ['def clean(); end']) end it 'displays nothing on the view' do @view.should_receive(:output).with('') @cmd.execute(@view) end it 'tells the view it succeeded' do @view.should_receive(:report_success) @cmd.execute(@view) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reek-1.3.4 | spec/reek/cli/reek_command_spec.rb |
reek-1.3.3 | spec/reek/cli/reek_command_spec.rb |