Sha256: 1bc9364ffcbe26e53083f3de665921089f545ea0aed30a73ab00024e802905ea

Contents?: true

Size: 668 Bytes

Versions: 6

Compression:

Stored size: 668 Bytes

Contents

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

describe Roodi::Checks::ControlCouplingCheck do
  before(:each) do
    @roodi = Roodi::Core::ParseTreeRunner.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 eql("dummy-file.rb:2 - Method \"write\" uses the argument \"quoted\" for internal control.")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
roodi-1.3.2 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.3.3 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.3.5 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.3.6 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.3.7 spec/roodi/checks/control_coupling_check_spec.rb
roodi-1.3.4 spec/roodi/checks/control_coupling_check_spec.rb