Sha256: a82d9dcca9ec28419ec954bacca4b2c29fd0d262ba5f31f0d3db6b507d644d44

Contents?: true

Size: 990 Bytes

Versions: 7

Compression:

Stored size: 990 Bytes

Contents

require 'test_helper'

module Pelusa
  describe RubyReporter do
    describe '#report' do
      before do
        too_many_lines = FailedAnalysis.new("Is below 50 lines", 200) do |lines|
          "There are #{lines} lines."
        end
        okay = SuccessfulAnalysis.new("Is below 50 lines")

        @reports =  [
          Report.new("Foo", [ too_many_lines ]),
          Report.new("Bar", [ okay ])
        ]

        @reporter = RubyReporter.new('foo.rb')
        @reporter.reports = @reports
      end

      it 'returns a hashified version of the reports' do
        @reporter.report.must_equal({
          "Foo" => {
            "Is below 50 lines" => {
              status: "failed",
              message: "There are 200 lines."
            }
          },

          "Bar" => {
            "Is below 50 lines" => {
              status: "successful",
              message: ""
            }
          },

          :filename => "foo.rb"
        })
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pelusa-0.2.2 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.2.1 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.2.0 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.1.1 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.1.0 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.0.2 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.0.1 test/pelusa/reporters/ruby_reporter_test.rb