Skip to content

Commit d0c1b23

Browse files
committed
Cleanups per RuboCop
1 parent 8d557b0 commit d0c1b23

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

spec/mysql2/client_spec.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,16 @@ def run_gc
435435

436436
it "should set default program_name in connect_attrs" do
437437
client = new_client
438-
if Mysql2::Client.info[:version] < '5.6' or client.info[:version] < '5.6'
438+
if Mysql2::Client.info[:version] < '5.6' || client.info[:version] < '5.6'
439439
pending('Both client and server versions must be MySQL 5.6 or later.')
440440
end
441441
result = client.query("SELECT attr_value FROM performance_schema.session_account_connect_attrs WHERE processlist_id = connection_id() AND attr_name = 'program_name'")
442-
expect(result.first['attr_value']).to eq($0)
442+
expect(result.first['attr_value']).to eq($PROGRAM_NAME)
443443
end
444444

445445
it "should set custom connect_attrs" do
446-
client = new_client(:connect_attrs => {:program_name => 'my_program_name', :foo => 'fooval', :bar => 'barval'})
447-
if Mysql2::Client.info[:version] < '5.6' or client.info[:version] < '5.6'
446+
client = new_client(:connect_attrs => { :program_name => 'my_program_name', :foo => 'fooval', :bar => 'barval' })
447+
if Mysql2::Client.info[:version] < '5.6' || client.info[:version] < '5.6'
448448
pending('Both client and server versions must be MySQL 5.6 or later.')
449449
end
450450
results = Hash[client.query("SELECT * FROM performance_schema.session_account_connect_attrs WHERE processlist_id = connection_id()").map { |x| x.values_at('ATTR_NAME', 'ATTR_VALUE') }]
@@ -802,16 +802,16 @@ def run_gc
802802
}.not_to raise_error
803803
end
804804

805-
it "should carry over the original string's encoding" do
806-
str = "abc'def\"ghi\0jkl%mno"
807-
escaped = Mysql2::Client.escape(str)
808-
expect(escaped.encoding).to eql(str.encoding)
805+
it "should carry over the original string's encoding" do
806+
str = "abc'def\"ghi\0jkl%mno"
807+
escaped = Mysql2::Client.escape(str)
808+
expect(escaped.encoding).to eql(str.encoding)
809809

810-
str.encode!('us-ascii')
811-
escaped = Mysql2::Client.escape(str)
812-
expect(escaped.encoding).to eql(str.encoding)
813-
end
810+
str.encode!('us-ascii')
811+
escaped = Mysql2::Client.escape(str)
812+
expect(escaped.encoding).to eql(str.encoding)
814813
end
814+
end
815815

816816
it "should respond to #escape" do
817817
expect(@client).to respond_to(:escape)
@@ -1039,7 +1039,7 @@ def run_gc
10391039
client.query('SELECT 1')
10401040
end
10411041

1042-
it "should respond to #encoding" do
1043-
expect(@client).to respond_to(:encoding)
1044-
end
1042+
it "should respond to #encoding" do
1043+
expect(@client).to respond_to(:encoding)
10451044
end
1045+
end

0 commit comments

Comments
 (0)