Skip to content

Commit 46f4fcd

Browse files
committed
get rid of some more warnings
1 parent e7e4341 commit 46f4fcd

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

spec/em/em_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
defer1.callback do |result|
3535
results << result.first
3636
defer2 = client.query "SELECT sleep(0.025) as second_query"
37-
defer2.callback do |result|
38-
results << result.first
37+
defer2.callback do |r|
38+
results << r.first
3939
EM.stop_event_loop
4040
end
4141
end

spec/mysql2/client_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
if defined? Encoding
1818
it "should raise an exception on create for invalid encodings" do
1919
lambda {
20-
c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "fake"))
20+
Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "fake"))
2121
}.should raise_error(Mysql2::Error)
2222
end
2323

2424
it "should not raise an exception on create for a valid encoding" do
2525
lambda {
26-
c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "utf8"))
26+
Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "utf8"))
2727
}.should_not raise_error(Mysql2::Error)
2828

2929
lambda {
30-
c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "big5"))
30+
Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "big5"))
3131
}.should_not raise_error(Mysql2::Error)
3232
end
3333
end
@@ -160,8 +160,8 @@ def connect *args
160160
@client.query("INSERT INTO infoTest (blah) VALUES (1234),(4535)")
161161
end
162162
it "should retrieve it" do
163-
@client.query_info.should == {:records => 2, :duplicates => 0, :warnings => 0}
164-
@client.query_info_string.should eq 'Records: 2 Duplicates: 0 Warnings: 0'
163+
@client.query_info.should eql({:records => 2, :duplicates => 0, :warnings => 0})
164+
@client.query_info_string.should eq('Records: 2 Duplicates: 0 Warnings: 0')
165165
end
166166
end
167167
end
@@ -419,12 +419,12 @@ def connect *args
419419
end
420420

421421
it "returns multiple result sets" do
422-
@multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'").first.should == { 'set_1' => 1 }
422+
@multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'").first.should eql({ 'set_1' => 1 })
423423

424-
@multi_client.next_result.should == true
425-
@multi_client.store_result.first.should == { 'set_2' => 2 }
424+
@multi_client.next_result.should be_true
425+
@multi_client.store_result.first.should eql({ 'set_2' => 2 })
426426

427-
@multi_client.next_result.should == false
427+
@multi_client.next_result.should be_false
428428
end
429429

430430
it "does not interfere with other statements" do
@@ -453,12 +453,12 @@ def connect *args
453453

454454
it "#more_results? should work" do
455455
@multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'")
456-
@multi_client.more_results?.should == true
456+
@multi_client.more_results?.should be_true
457457

458458
@multi_client.next_result
459459
@multi_client.store_result
460460

461-
@multi_client.more_results?.should == false
461+
@multi_client.more_results?.should be_false
462462
end
463463
end
464464
end
@@ -621,11 +621,11 @@ def connect *args
621621

622622
it "should raise a Mysql2::Error exception upon connection failure" do
623623
lambda {
624-
bad_client = Mysql2::Client.new :host => "localhost", :username => 'asdfasdf8d2h', :password => 'asdfasdfw42'
624+
Mysql2::Client.new :host => "localhost", :username => 'asdfasdf8d2h', :password => 'asdfasdfw42'
625625
}.should raise_error(Mysql2::Error)
626626

627627
lambda {
628-
good_client = Mysql2::Client.new DatabaseCredentials['root']
628+
Mysql2::Client.new DatabaseCredentials['root']
629629
}.should_not raise_error(Mysql2::Error)
630630
end
631631

spec/mysql2/result_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@
148148
it "should return nil values for NULL and strings for everything else when :cast is false" do
149149
result = @client.query('SELECT null_test, tiny_int_test, bool_cast_test, int_test, date_test, enum_test FROM mysql2_test WHERE bool_cast_test = 1 LIMIT 1', :cast => false).first
150150
result["null_test"].should be_nil
151-
result["tiny_int_test"].should == "1"
152-
result["bool_cast_test"].should == "1"
153-
result["int_test"].should == "10"
154-
result["date_test"].should == "2010-04-04"
155-
result["enum_test"].should == "val1"
151+
result["tiny_int_test"].should eql("1")
152+
result["bool_cast_test"].should eql("1")
153+
result["int_test"].should eql("10")
154+
result["date_test"].should eql("2010-04-04")
155+
result["enum_test"].should eql("val1")
156156
end
157157

158158
it "should return nil for a NULL value" do

0 commit comments

Comments
 (0)