spec/token_scanner_spec.rb in dentaku-1.2.6 vs spec/token_scanner_spec.rb in dentaku-2.0.0

- old
+ new

@@ -1,10 +1,12 @@ require 'dentaku/token_scanner' describe Dentaku::TokenScanner do let(:whitespace) { described_class.new(:whitespace, '\s') } - let(:numeric) { described_class.new(:numeric, '(\d+(\.\d+)?|\.\d+)', lambda{|raw| raw =~ /\./ ? BigDecimal.new(raw) : raw.to_i }) } + let(:numeric) { described_class.new(:numeric, '(\d+(\.\d+)?|\.\d+)', + lambda{|raw| raw =~ /\./ ? BigDecimal.new(raw) : raw.to_i }) + } it 'returns a token for a matching string' do token = whitespace.scan(' ').first expect(token.category).to eq(:whitespace) expect(token.value).to eq(' ') @@ -19,9 +21,8 @@ expect(token.category).to eq(:numeric) expect(token.value).to eq(5) end it 'returns a list of all configured scanners' do - expect(described_class.scanners.length).to eq 10 + expect(described_class.scanners.length).to eq 11 end end -