Skip to content

Commit

Permalink
More ruby warning fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jun 7, 2023
1 parent 2e9ed41 commit fa66bb9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion spec/mixin_queryable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
end

context "Querying for solutions from a BGP" do
let(:query) { query = RDF::Query.new {pattern %i(s p o)} }
let(:query) { RDF::Query.new {pattern %i(s p o)} }
it "calls #query_execute" do
is_expected.to receive(:query_execute)
is_expected.not_to receive(:query_pattern)
Expand Down
4 changes: 1 addition & 3 deletions spec/model_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,13 @@
context :with_transaction do
it "uses a transaction for the graph" do
n = RDF::Node.new
l = RDF::List.new(subject: n, graph: graph, wrap_transaction: true) do |list|
RDF::List.new(subject: n, graph: graph, wrap_transaction: true) do |list|
expect(list.graph).to be_a(RDF::Transaction)
expect(list.graph).not_to equal graph
end
end

it "adds values in a transaction" do
n = RDF::Node.new
l = RDF::List.new(graph: graph, wrap_transaction: true) do |list|
list << RDF::Literal(1)
expect(graph.first_object(subject: list.subject, predicate: RDF.first)).to be_nil
Expand All @@ -180,7 +179,6 @@
end

it "rollback added values in a transaction" do
n = RDF::Node.new
l = RDF::List.new(graph: graph, wrap_transaction: true) do |list|
list << RDF::Literal(1)
expect(graph.first_object(subject: list.subject, predicate: RDF.first)).to be_nil
Expand Down
4 changes: 2 additions & 2 deletions spec/model_uri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@
end
end

%W(` ^ \\ \u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006
(%W(` ^ \\ \u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006
\u0010 \u0020 \u003c \u003e \u0022 \u007b \u007d) +
[" ", "<", ">", "'" '"'].each do |c|
[" ", "<", ">", "'" '"']).each do |c|
it "does not validate <http://example/#{c}>" do
expect(RDF::URI("http://example/#{c}")).not_to be_valid
end
Expand Down
6 changes: 3 additions & 3 deletions spec/nquads_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
subject { described_class }

describe ".for" do
formats = [
[
:nquads,
'etc/doap.nq',
{file_name: 'etc/doap.nq'},
Expand Down Expand Up @@ -99,7 +99,7 @@
end

describe ".for" do
formats = [
[
:nquads,
'etc/doap.nq',
{file_name: 'etc/doap.nq'},
Expand Down Expand Up @@ -236,7 +236,7 @@
subject { RDF::NQuads::Writer.new }

describe ".for" do
formats = [
[
:nquads,
'etc/doap.nq',
{file_name: 'etc/doap.nq'},
Expand Down
2 changes: 1 addition & 1 deletion spec/query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@
context "Examples" do
let!(:graph) {RDF::Graph.new.insert(RDF::Spec.triples.extend(RDF::Enumerable))}
subject {
query = RDF::Query.new do
RDF::Query.new do
pattern [:person, RDF.type, FOAF.Person]
pattern [:person, FOAF.name, :name]
pattern [:person, FOAF.mbox, :email]
Expand Down
2 changes: 0 additions & 2 deletions spec/reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@

it "uses content type in preference to file extension" do
uri = "http://example/foo.nq"
accept = (RDF::Format.accept_types + %w(*/*;q=0.1)).join(", ")
reader_mock = double("reader")
expect(reader_mock).to receive(:got_here)
WebMock.
Expand All @@ -74,7 +73,6 @@

it "ignores content type 'text/plain'" do
uri = "http://example/foo.ttl"
accept = (RDF::Format.accept_types + %w(*/*;q=0.1)).join(", ")
reader_mock = double("reader")
expect(reader_mock).to receive(:got_here)
WebMock.
Expand Down
2 changes: 1 addition & 1 deletion spec/util_logger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def initialize(logger = nil)

it "adds locaton to log message" do
expect {subject.log_fatal("foo")}.to raise_error(StandardError)
expect(subject.logger.to_s).to match /Called from #{File.expand_path("", __FILE__)}:#{__LINE__-1}/
expect(subject.logger.to_s).to match(/Called from #{File.expand_path("", __FILE__)}:#{__LINE__-1}/)
end

it "logs to $stderr if logger not configured" do
Expand Down

0 comments on commit fa66bb9

Please sign in to comment.