Sha256: 099d3cd1cc5f9de0b2bb529db1b78cb3330152d800cee741b8ed38c1a05c5767

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

require 'spec_helper'

describe RailsBestPractices::Core::Error do
  it "should return error with filename, line number and message" do
    RailsBestPractices::Core::Error.new("app/models/user.rb", "100", "not good", "BogusReview").to_s.should == "app/models/user.rb:100 - not good"
  end

  it "should return short filename" do
    RailsBestPractices::Core::Runner.base_path = "../rails-bestpractices.com"
    RailsBestPractices::Core::Error.new("../rails-bestpractices.com/app/models/user.rb", "100", "not good", "BogusReview").short_filename.should == "app/models/user.rb"
  end

  it "should return first line number" do
    RailsBestPractices::Core::Error.new("app/models/user.rb", "50,70,100", "not good", "BogusReview").first_line_number.should == "50"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_best_practices-1.7.2 spec/rails_best_practices/core/error_spec.rb
rails_best_practices-1.7.1 spec/rails_best_practices/core/error_spec.rb
rails_best_practices-1.7.0 spec/rails_best_practices/core/error_spec.rb
rails_best_practices-1.6.0 spec/rails_best_practices/core/error_spec.rb