Sha256: fa6421ca6d0ac53555b6b69bf9d419b1dae08306e5a5e4dbbe9c552dc52aa29f

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 Bytes

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('`' => '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('`' => '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('`' => shell_output)
    subject.result.should == { type: :reek, check_output: '', status: "\e[33m2 Codesmell\e[0m" }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake_check-0.0.1 spec/lib/rake_check/reek_checker_spec.rb