Sha256: cd0522822d2efb00c850a5d7f1f08d3fc6d5781d79561deb00b2b2608ec348b2

Contents?: true

Size: 756 Bytes

Versions: 7

Compression:

Stored size: 756 Bytes

Contents

require 'test_helper'

module Pelusa
  describe Analyzer do
    describe '#analyze' do
      before do
        @ast = """
          class Foo
            def bar
              123
            end
          end

          class Bar
            def baz
              321
            end
          end
        """.to_ast

        lints = stub
        @analyzer = Analyzer.new([Lint::LineRestriction], RubyReporter, "foo.rb")
      end

      it 'analyzes an ast and returns a report' do
        result = @analyzer.analyze(@ast).report
        result[:filename].must_equal "foo.rb"
        result[:Foo]["Is below 50 lines"][:status].must_equal "successful"
        result[:Bar]["Is below 50 lines"][:status].must_equal "successful"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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