Sha256: d666de9ee507fff193a05004186ae300cd23282a936ed647a928735f3a86983b

Contents?: true

Size: 666 Bytes

Versions: 15

Compression:

Stored size: 666 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.make)
  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

15 entries across 15 versions & 2 rubygems

Version Path
roodi-5.0.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-4.1.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-4.1.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-4.0.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.3.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.3.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.2.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.1.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.1.0 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.0.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-3.0.0 spec/roodi/checks/control_coupling_check_spec.rb
metric_fu-roodi-2.2.2 spec/roodi/checks/control_coupling_check_spec.rb
metric_fu-roodi-2.2.1 spec/roodi/checks/control_coupling_check_spec.rb
roodi-2.2.0 spec/roodi/checks/control_coupling_check_spec.rb
metric_fu-roodi-2.2.0 spec/roodi/checks/control_coupling_check_spec.rb