Guest User

Untitled

a guest
Mar 8th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. it "raises a TypeError when the given String can't be fully converted to a Float" do
  2. lambda { Float('0.0.0') }.should raise_error(ArgumentError)
  3. end
  4.  
  5. # Possibility 1
  6. it "raises a TypeError when the given String can't be fully converted to a Float", :should_raise => ArgumentError do
  7. Float('0.0.0')
  8. end
  9.  
  10. # Possibility 2
  11. it_should_raise(ArgumentError) do
  12. Float('0.0.0')
  13. end
Add Comment
Please, Sign In to add comment