Sha256: a552c73f0ce29113f17d2256fbce8712004acf610aa06462d5056182331fa1d3

Contents?: true

Size: 665 Bytes

Versions: 6

Compression:

Stored size: 665 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Roodi::Checks::ControlCouplingCheck do
  before(:each) do
    @roodi = Roodi::Core::Runner.new(Roodi::Checks::ControlCouplingCheck.new)
  end
  
  it "should reject methods with if checks using a parameter" do
    content = <<-END
    def write(quoted, foo)
     if quoted
       write_quoted(@value)
     else
       puts @value
      end
    end
    END
    @roodi.check_content(content)
    errors = @roodi.errors
    errors.should_not be_empty
    errors[0].to_s.should match(/dummy-file.rb:[2-3] - Method \"write\" uses the argument \"quoted\" for internal control./)
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
threedaymonk-roodi-1.3.8 spec/roodi/checks/control_coupling_check_spec.rb
roodi1.9-2.0.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-2.1.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-2.0.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-2.0.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.4.0 spec/roodi/checks/control_coupling_check_spec.rb