Skip to content

Commit 5e32ea6

Browse files
committed
Add some tests for Literal#english?
1 parent 55afa63 commit 5e32ea6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

spec/model_literal_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,22 @@ def self.literals(*selector)
133133
end
134134
end
135135

136+
describe "#english?" do
137+
literals(:all).each do |args|
138+
options = args.last.is_a?(Hash) ? args.pop : {}
139+
lit = RDF::Literal.new(*args, **options)
140+
if lit.language? && lit.language.to_s.downcase.start_with?('en')
141+
it "returns true for #{lit.inspect}" do
142+
expect(lit).to be_english
143+
end
144+
else
145+
it "returns false for #{lit.inspect}" do
146+
expect(lit).not_to be_english
147+
end
148+
end
149+
end
150+
end
151+
136152
describe "#datatype" do
137153
literals(:all_simple).each do |args|
138154
it "returns xsd:string for #{args.inspect}" do

0 commit comments

Comments
 (0)