|
17 | 17 | if defined? Encoding
|
18 | 18 | it "should raise an exception on create for invalid encodings" do
|
19 | 19 | lambda {
|
20 |
| - c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "fake")) |
| 20 | + Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "fake")) |
21 | 21 | }.should raise_error(Mysql2::Error)
|
22 | 22 | end
|
23 | 23 |
|
24 | 24 | it "should not raise an exception on create for a valid encoding" do
|
25 | 25 | lambda {
|
26 |
| - c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "utf8")) |
| 26 | + Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "utf8")) |
27 | 27 | }.should_not raise_error(Mysql2::Error)
|
28 | 28 |
|
29 | 29 | lambda {
|
30 |
| - c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "big5")) |
| 30 | + Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "big5")) |
31 | 31 | }.should_not raise_error(Mysql2::Error)
|
32 | 32 | end
|
33 | 33 | end
|
@@ -160,8 +160,8 @@ def connect *args
|
160 | 160 | @client.query("INSERT INTO infoTest (blah) VALUES (1234),(4535)")
|
161 | 161 | end
|
162 | 162 | 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') |
165 | 165 | end
|
166 | 166 | end
|
167 | 167 | end
|
@@ -419,12 +419,12 @@ def connect *args
|
419 | 419 | end
|
420 | 420 |
|
421 | 421 | 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 }) |
423 | 423 |
|
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 }) |
426 | 426 |
|
427 |
| - @multi_client.next_result.should == false |
| 427 | + @multi_client.next_result.should be_false |
428 | 428 | end
|
429 | 429 |
|
430 | 430 | it "does not interfere with other statements" do
|
@@ -453,12 +453,12 @@ def connect *args
|
453 | 453 |
|
454 | 454 | it "#more_results? should work" do
|
455 | 455 | @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 |
457 | 457 |
|
458 | 458 | @multi_client.next_result
|
459 | 459 | @multi_client.store_result
|
460 | 460 |
|
461 |
| - @multi_client.more_results?.should == false |
| 461 | + @multi_client.more_results?.should be_false |
462 | 462 | end
|
463 | 463 | end
|
464 | 464 | end
|
@@ -621,11 +621,11 @@ def connect *args
|
621 | 621 |
|
622 | 622 | it "should raise a Mysql2::Error exception upon connection failure" do
|
623 | 623 | lambda {
|
624 |
| - bad_client = Mysql2::Client.new :host => "localhost", :username => 'asdfasdf8d2h', :password => 'asdfasdfw42' |
| 624 | + Mysql2::Client.new :host => "localhost", :username => 'asdfasdf8d2h', :password => 'asdfasdfw42' |
625 | 625 | }.should raise_error(Mysql2::Error)
|
626 | 626 |
|
627 | 627 | lambda {
|
628 |
| - good_client = Mysql2::Client.new DatabaseCredentials['root'] |
| 628 | + Mysql2::Client.new DatabaseCredentials['root'] |
629 | 629 | }.should_not raise_error(Mysql2::Error)
|
630 | 630 | end
|
631 | 631 |
|
|
0 commit comments