Sha256: db6292d7bc2abe0e4ce9774017e18fd9244afecb87473d22c7653fb0c8adb3da
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
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 it "should not remove empty application_helper" do content =<<-EOF module ApplicationHelper end EOF runner.review('app/helpers/application_helper.rb', content) runner.should have(0).errors end end end end
Version data entries
13 entries across 13 versions & 1 rubygems