Skip to content

Commit fa66bb9

Browse files
committed
More ruby warning fixes.
1 parent 2e9ed41 commit fa66bb9

7 files changed

Lines changed: 9 additions & 13 deletions

File tree

spec/mixin_queryable_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
end
3030

3131
context "Querying for solutions from a BGP" do
32-
let(:query) { query = RDF::Query.new {pattern %i(s p o)} }
32+
let(:query) { RDF::Query.new {pattern %i(s p o)} }
3333
it "calls #query_execute" do
3434
is_expected.to receive(:query_execute)
3535
is_expected.not_to receive(:query_pattern)

spec/model_list_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,13 @@
163163
context :with_transaction do
164164
it "uses a transaction for the graph" do
165165
n = RDF::Node.new
166-
l = RDF::List.new(subject: n, graph: graph, wrap_transaction: true) do |list|
166+
RDF::List.new(subject: n, graph: graph, wrap_transaction: true) do |list|
167167
expect(list.graph).to be_a(RDF::Transaction)
168168
expect(list.graph).not_to equal graph
169169
end
170170
end
171171

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

182181
it "rollback added values in a transaction" do
183-
n = RDF::Node.new
184182
l = RDF::List.new(graph: graph, wrap_transaction: true) do |list|
185183
list << RDF::Literal(1)
186184
expect(graph.first_object(subject: list.subject, predicate: RDF.first)).to be_nil

spec/model_uri_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,9 @@
379379
end
380380
end
381381

382-
%W(` ^ \\ \u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006
382+
(%W(` ^ \\ \u0000 \u0001 \u0002 \u0003 \u0004 \u0005 \u0006
383383
\u0010 \u0020 \u003c \u003e \u0022 \u007b \u007d) +
384-
[" ", "<", ">", "'" '"'].each do |c|
384+
[" ", "<", ">", "'" '"']).each do |c|
385385
it "does not validate <http://example/#{c}>" do
386386
expect(RDF::URI("http://example/#{c}")).not_to be_valid
387387
end

spec/nquads_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
subject { described_class }
1515

1616
describe ".for" do
17-
formats = [
17+
[
1818
:nquads,
1919
'etc/doap.nq',
2020
{file_name: 'etc/doap.nq'},
@@ -99,7 +99,7 @@
9999
end
100100

101101
describe ".for" do
102-
formats = [
102+
[
103103
:nquads,
104104
'etc/doap.nq',
105105
{file_name: 'etc/doap.nq'},
@@ -236,7 +236,7 @@
236236
subject { RDF::NQuads::Writer.new }
237237

238238
describe ".for" do
239-
formats = [
239+
[
240240
:nquads,
241241
'etc/doap.nq',
242242
{file_name: 'etc/doap.nq'},

spec/query_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@
968968
context "Examples" do
969969
let!(:graph) {RDF::Graph.new.insert(RDF::Spec.triples.extend(RDF::Enumerable))}
970970
subject {
971-
query = RDF::Query.new do
971+
RDF::Query.new do
972972
pattern [:person, RDF.type, FOAF.Person]
973973
pattern [:person, FOAF.name, :name]
974974
pattern [:person, FOAF.mbox, :email]

spec/reader_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959

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

7574
it "ignores content type 'text/plain'" do
7675
uri = "http://example/foo.ttl"
77-
accept = (RDF::Format.accept_types + %w(*/*;q=0.1)).join(", ")
7876
reader_mock = double("reader")
7977
expect(reader_mock).to receive(:got_here)
8078
WebMock.

spec/util_logger_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def initialize(logger = nil)
4848

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

5454
it "logs to $stderr if logger not configured" do

0 commit comments

Comments
 (0)