Sha256: 1a2144b7b8a428904f02625445af4392362d51959693aa8fcf94ad2f5f5ed7fa

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../../lib/rake_check/brakeman_checker')
require_relative '../../spec_helper'

describe BrakemanChecker do
  let(:tracker) { stub("Tracker", checks: stub("Checks", warnings: [])) }
  it "gives N/A on no Rails Apps" do
    Brakeman.should_receive(:run)
    subject.result.should == { type: :brakeman, check_output: '', status: 'N/A' }
  end
  it "gives OK with no Errors" do
    Brakeman.should_receive(:run).and_return tracker
    subject.result.should == { type: :brakeman,
                               check_output: '',
                               status: "\e[32m0\e[0m Warnings" }
  end
  describe "Code Coverage" do
    it "is red with warnings" do
      tracker.checks.stub(warnings: [stub("Warning")])
      tracker.stub(report: "Report")
      Brakeman.should_receive(:run).and_return tracker
      subject.result.should == { type: :brakeman,
                                 check_output: 'Report',
                                 status: "\e[31m1\e[0m Warnings" }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rake_check-0.3.5 spec/lib/rake_check/brakeman_checker_spec.rb
rake_check-0.3.4 spec/lib/rake_check/brakeman_checker_spec.rb
rake_check-0.3.3 spec/lib/rake_check/brakeman_checker_spec.rb
rake_check-0.3.2 spec/lib/rake_check/brakeman_checker_spec.rb
rake_check-0.3.1 spec/lib/rake_check/brakeman_checker_spec.rb