Skip to content

Commit 3969bdf

Browse files
committed
Fix URI.intern arguments.
1 parent 0e8db6e commit 3969bdf

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/rdf/model/uri.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def self.cache
141141
#
142142
# (see #initialize)
143143
# @return [RDF::URI] an immutable, frozen URI object
144-
def self.intern(str, *args)
145-
(cache[(str = str.to_s).to_sym] ||= self.new(str, *args)).freeze
144+
def self.intern(str, *args, **options)
145+
(cache[(str = str.to_s).to_sym] ||= self.new(str, *args, **options)).freeze
146146
end
147147

148148
##

spec/model_uri_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
expect(RDF::URI.intern("a")).to be_frozen
1818
end
1919

20+
it "freezes an instance with options" do
21+
expect(RDF::URI.intern("http://example.org/", validate: true)).to be_frozen
22+
end
23+
2024
it "does not use #to_hash given a URI" do
2125
expect {RDF::URI.intern(RDF::URI("a"))}.not_to write.to(:error)
2226
end

0 commit comments

Comments
 (0)