Sha256: 6957b084916f41d3923703be1c5095e086eef57a31057c0b6f69910e802aed99
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
shared_examples_for 'a variable detector' do context 'with no variables' do it "doesn't record a smell" do @detector.examine_context(@ctx) @detector.smells_found.length.should == 0 end end context 'with one variable encountered twice' do before :each do @ctx.send(@record_variable, :something) @ctx.send(@record_variable, :something) @detector.examine_context(@ctx) end it 'records only one smell' do @detector.smells_found.length.should == 1 end it 'mentions the variable name in the report' do @detector.should have_smell([/something/]) end end context 'with two variables' do before :each do @ctx.send(@record_variable, :something) @ctx.send(@record_variable, :something_else) @detector.examine_context(@ctx) end it 'records both smells' do @detector.num_smells.should == 2 end it 'mentions both variable names in the report' do @detector.should have_smell([/something/]) @detector.should have_smell([/something_else/]) end end end
Version data entries
16 entries across 16 versions & 1 rubygems