Skip to content

Commit

Permalink
Spec for Token#to_s
Browse files Browse the repository at this point in the history
Token#to_s was introduced in rubocop#8
and seems untested forever. I assume it was introduced for debugging
purposes.
  • Loading branch information
bquorning committed Dec 28, 2014
1 parent 94e2264 commit 47644e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/rubocop/token_spec.rb
Expand Up @@ -8,7 +8,7 @@
let(:parser_token) { [type, [text, range]] }
let(:type) { :kDEF }
let(:text) { 'def' }
let(:range) { double('range') }
let(:range) { double('range', line: 42, column: 30) }

it "sets parser token's type to rubocop token's type" do
expect(token.type).to eq(type)
Expand All @@ -21,5 +21,9 @@
it "sets parser token's range to rubocop token's pos" do
expect(token.pos).to eq(range)
end

it 'returns a #to_s useful for debugging' do
expect(token.to_s).to eq('[[42, 30], kDEF, "def"]')
end
end
end

0 comments on commit 47644e4

Please sign in to comment.