Sha256: 38a1cad98033a6cf95e4bb2d40a6bb8ed52a3a1bcea73a21c3da8f9adcb3ab6a
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Simplabs::Excellent::Checks::FlogMethodCheck do before do @excellent = Simplabs::Excellent::Runner.new(Simplabs::Excellent::Checks::FlogMethodCheck.new({ :threshold => 0 })) end describe '#evaluate' do it 'should calculate the score correctly' do content = <<-END def method_name puts 'test' end END verify_content_score(content, 1) end it 'should calculate the score that uses special metaprogramming methods correctly' do content = <<-END def method_name @instance.instance_eval do def some_method end end end END verify_content_score(content, 6) end end def verify_content_score(content, score) @excellent.check_content(content) warnings = @excellent.warnings warnings.should_not be_empty warnings[0].info.should == { :method => 'method_name', :score => score } warnings[0].line_number.should == 1 warnings[0].message.should == "method_name has flog score of #{score}." end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simplabs-excellent-1.2.1 | spec/checks/flog_method_check_spec.rb |