Sha256: 14eb21d44336966a75a5b7cbcdfc07c3881993817b1e03170e023c5509bef5eb

Contents?: true

Size: 1009 Bytes

Versions: 2

Compression:

Stored size: 1009 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", "class", [ too_many_lines ]),
          Report.new("Bar", "module", [ 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

2 entries across 2 versions & 1 rubygems

Version Path
pelusa-0.2.4 test/pelusa/reporters/ruby_reporter_test.rb
pelusa-0.2.3 test/pelusa/reporters/ruby_reporter_test.rb