Sha256: ce3820ca6e84f9df8c2ccd17a18f616277ddb281d18058cbbaccab29bae17672
Contents?: true
Size: 1.08 KB
Versions: 19
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe RailsBestPractices::Lexicals::RemoveTabCheck do let(:runner) { RailsBestPractices::Core::Runner.new(:lexicals => RailsBestPractices::Lexicals::RemoveTabCheck.new) } it "should remove tab" do content =<<-EOF class User < ActiveRecord::Base has_many :projects end EOF content.gsub!("\n", "\t\n") runner.lexical('app/models/user.rb', content) runner.should have(1).errors runner.errors[0].to_s.should == "app/models/user.rb:1 - remove tab, use spaces instead" end it "should remove tab with third line" do content =<<-EOF class User < ActiveRecord::Base has_many :projects \t end EOF runner.lexical('app/models/user.rb', content) runner.should have(1).errors runner.errors[0].to_s.should == "app/models/user.rb:3 - remove tab, use spaces instead" end it "should not remove trailing whitespace" do content =<<-EOF class User < ActiveRecord::Base has_many :projects end EOF runner.lexical('app/models/user.rb', content) runner.should have(0).errors end end
Version data entries
19 entries across 19 versions & 2 rubygems