Sha256: 93ebb6405e34c9d02f42e81f5a1e151c63dacf9bb8e7d8850b87633a20668d66

Contents?: true

Size: 765 Bytes

Versions: 21

Compression:

Stored size: 765 Bytes

Contents

require 'spec_helper'

describe RailsBestPractices::Reviews::RemoveEmptyHelpersReview do
  let(:runner) { RailsBestPractices::Core::Runner.new(:reviews => RailsBestPractices::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

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
rails_best_practices-gorgeouscode-1.0.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.9.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.8.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.7.2 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.7.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.7.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.6.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.5.3 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.5.2 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.5.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.5.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.4.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.3.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.2.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.1.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.0.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-1.0.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-0.10.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-0.10.0 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb
rails_best_practices-raydog153-0.9.1 spec/rails_best_practices/reviews/remove_empty_helpers_review_spec.rb