Sha256: 9707dce51eb0c77b255b33cd33e9b3de387e011af5bae354512899527f33b9d5

Contents?: true

Size: 829 Bytes

Versions: 4

Compression:

Stored size: 829 Bytes

Contents

require 'spec_helper'

module RailsBestPractices
  module Reviews
    describe RemoveEmptyHelpersReview do
      let(:runner) { Core::Runner.new(reviews: RemoveEmptyHelpersReview.new) }

      it "should remove empty helpers" do
        content =<<-EOF
        module PostsHelper
        end
        EOF
        runner.review('app/helpers/posts_helper.rb', content)
        runner.should have(1).errors
        runner.errors[0].to_s.should == "app/helpers/posts_helper.rb:1 - remove empty helpers"
      end

      it "should not remove empty helpers" do
        content =<<-EOF
        module PostsHelper
          def post_link(post)
            post_path(post)
          end
        end
        EOF
        runner.review('app/helpers/posts_helper.rb', content)
        runner.should have(0).errors
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_best_practices-1.11.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.11.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.10.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.10.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb