Skip to content
Browse files

add to_i

  • Loading branch information...
1 parent 7d93727 commit f69e87532b4fbf0329b693edc1f3a3c24aa8f52b @grosser committed Jan 16, 2011
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/string19.rb
  2. +5 −0 spec/string19_spec.rb
View
2 lib/string19.rb
@@ -98,7 +98,7 @@ def self.delegate_to_s(*args)
wrap :dup, :slice, :slice!, :[], :inspect
delegate :size
- delegate_to_s :match, :bytes
+ delegate_to_s :match, :bytes, :to_i
end
end
else
View
5 spec/string19_spec.rb
@@ -206,4 +206,9 @@ def enumerator
"#{String19('xxx')}".should == "xxx"
end
end
+
+ it 'to_i' do
+ String19('1').to_i.should == 1
+ String19('').to_i.should == 0
+ end
end

0 comments on commit f69e875

Please sign in to comment.
Something went wrong with that request. Please try again.