Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added a basic Offence spec

  • Loading branch information...
commit 00e7b4e83db0241a2ab1d61a672b5bde72080ff8 1 parent 3623e62
@bbatsov authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 spec/rubocop/cops/offence_spec.rb
View
22 spec/rubocop/cops/offence_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+module Rubocop
+ module Cop
+ describe Offence do
+ it 'has a few required attributes' do
+ offence = Offence.new('filename', 1, 'line', 'message')
+
+ offence.filename.should == 'filename'
+ offence.line_number.should == 1
+ offence.line.should == 'line'
+ offence.message.should == 'message'
+ end
+
+ it 'overrides #to_s' do
+ offence = Offence.new('filename', 1, 'line', 'message')
+
+ offence.to_s.should == 'filename:1:line - message'
+ end
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.