Skip to content

Commit

Permalink
Add some tests for Literal#english?
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jun 11, 2024
1 parent 55afa63 commit 5e32ea6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/model_literal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,22 @@ def self.literals(*selector)
end
end

describe "#english?" do
literals(:all).each do |args|
options = args.last.is_a?(Hash) ? args.pop : {}
lit = RDF::Literal.new(*args, **options)
if lit.language? && lit.language.to_s.downcase.start_with?('en')
it "returns true for #{lit.inspect}" do
expect(lit).to be_english
end
else
it "returns false for #{lit.inspect}" do
expect(lit).not_to be_english
end
end
end
end

describe "#datatype" do
literals(:all_simple).each do |args|
it "returns xsd:string for #{args.inspect}" do
Expand Down

1 comment on commit 5e32ea6

@artob
Copy link
Member

@artob artob commented on 5e32ea6 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.