Skip to content

Commit

Permalink
Fix test in Ruby > 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
porras committed Feb 14, 2014
1 parent 6383ad0 commit 704d32c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/test_data_uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@
@raw = "data:application/octet-stream;base64,#{Base64.encode64(@data).chop}"
end

it "shouldn't be parsed by URI.parse because the ABS_URI regexp is silly" do
uri = URI.parse(@raw)
assert uri.data != @data
it "isn't parsed by URI.parse" do
if RUBY_VERSION == "1.8.7"
uri = URI.parse(@raw)
refute_equal uri.data, @data
else
proc { URI.parse(@raw) }.must_raise(URI::InvalidURIError)
end
end

it "should be parsed by URI::Data.new" do
uri = URI::Data.new(@raw)
assert uri.data == @data
assert_equal uri.data, @data
end

end
Expand Down

0 comments on commit 704d32c

Please sign in to comment.