Sha256: 6dc5cfcef14b1e2ac3d5db4aae29c6c0b73371d23be23e5a5adf8ced50d345fd
Contents?: true
Size: 688 Bytes
Versions: 3
Compression:
Stored size: 688 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe Parsing::PositiveIntegerParser do parser = Parsing::PositiveIntegerParser.new ["1","50","05","502530"].each do |str| res = parser.parse(str) i = str.to_i it "should parse '#{str}'" do res.should_not be nil end it 'should return node that is convertible to integer using #to_i method' do res.to_i.should eq(i) end it 'should return node that is convertible to integer using #to_num method' do res.to_num.should eq(i) end end ["0"].each do |str| it "should not parse '#{str}'" do parser.should_not parse(str) end end end
Version data entries
3 entries across 3 versions & 1 rubygems