Skip to content

Commit

Permalink
add test for symbol type
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Sep 1, 2017
1 parent 1272f92 commit 1d6293c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions spec/unit/kansen/mapper/note_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
expect(Kansen::Mapper::NoteParser.parse('constant', 'BasicObject')).
to be_a BasicObject
end
it 'returns symbol' do
expect(Kansen::Mapper::NoteParser.parse('symbol', 'foo')).
to be_a Symbol
end
end
end
2 changes: 1 addition & 1 deletion spec/unit/kansen/mapper/note_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

context 'when valid type' do
%w{
string integer float constant
string integer float constant symbol
}.each do |type|
it "returns #{type} type" do
expect(subject.perform(type)).to eq type
Expand Down
9 changes: 9 additions & 0 deletions spec/unit/kansen/parser/symbol_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'spec_helper'

describe Kansen::Parser::Integer do
describe '.parse' do
it 'converts note to integer' do
expect(Kansen::Parser::Symbol.parse('kansen')).to eq :kansen
end
end
end

0 comments on commit 1d6293c

Please sign in to comment.