Sha256: 55d5cd2a7f001375a0dddec49a4e08deb465460b1a82f886e777d47265af349b
Contents?: true
Size: 1.18 KB
Versions: 17
Compression:
Stored size: 1.18 KB
Contents
require 'spec_helper' module RailsBestPractices module Lexicals describe RemoveTabCheck do let(:runner) { Core::Runner.new(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 end end
Version data entries
17 entries across 17 versions & 1 rubygems