Sha256: ddb3853b9add1bb5b903c0ffbf2faa067946b571b9219214b12a8fb1c3439acf

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/reek_checker')
describe ReekChecker do
  it "gives N/A on Error" do
    require 'ruby_parser'
    subject.stub(:`).and_return('Error')
    subject.result.should == { type: :reek, check_output: 'Error', status: "\e[31mN/A\e[0m" }
  end
  it "gives OK on no Error" do
    subject.stub(:`).and_return('warning: already initialized constant ENC_UTF8')
    subject.result.should == { type: :reek, check_output: '', status: "\e[32mOK\e[0m" }
  end
  it "gives Error with on Codesmells" do
    shell_output = File.read(File.expand_path(File.dirname(__FILE__) +
                                              '/../../files/reek_output.yaml'))
    subject.stub(:`).and_return(shell_output)
    check_output = "DuplicateMethodCall: ReekChecker#status@19, 20, 21, 22, 23\n"
    check_output += "TooManyStatements: ReekChecker#status@17"
    subject.result.should == { type: :reek,
                               check_output: check_output, status: "\e[33m2 Codesmell\e[0m" }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rake_check-0.3.5 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.3.4 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.3.3 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.3.2 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.3.1 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.3.0 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.2.2 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.2.1 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.2 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.1.11 spec/lib/rake_check/reek_checker_spec.rb
rake_check-0.1.10 spec/lib/rake_check/reek_checker_spec.rb