Skip to content

Commit e95ed0e

Browse files
committed
Convert specs to RSpec 2.99.2 syntax with Transpec
This conversion is done by Transpec 3.1.0 with the following command: transpec -b true,false -f For more details: https://github.com/yujinakayama/transpec#supported-conversions
1 parent fdfb24e commit e95ed0e

File tree

6 files changed

+414
-414
lines changed

6 files changed

+414
-414
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gem 'rake-compiler', '~> 0.9.5'
77

88
group :test do
99
gem 'eventmachine' unless RUBY_PLATFORM =~ /mswin|mingw/
10-
gem 'rspec', '~> 2.8.0'
10+
gem 'rspec', '~> 2.99'
1111
end
1212

1313
group :benchmarks do

spec/em/em_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
end
2525
end
2626

27-
results[0].keys.should include("second_query")
28-
results[1].keys.should include("first_query")
27+
expect(results[0].keys).to include("second_query")
28+
expect(results[1].keys).to include("first_query")
2929
end
3030

3131
it "should support queries in callbacks" do
@@ -44,12 +44,12 @@
4444
end
4545
end
4646

47-
results[0].keys.should include("first_query")
48-
results[1].keys.should include("second_query")
47+
expect(results[0].keys).to include("first_query")
48+
expect(results[1].keys).to include("second_query")
4949
end
5050

5151
it "should not swallow exceptions raised in callbacks" do
52-
lambda {
52+
expect {
5353
EM.run do
5454
client = Mysql2::EM::Client.new DatabaseCredentials['root']
5555
defer = client.query "SELECT sleep(0.1) as first_query"
@@ -63,13 +63,13 @@
6363
EM.stop_event_loop
6464
end
6565
end
66-
}.should raise_error
66+
}.to raise_error
6767
end
6868

6969
context 'when an exception is raised by the client' do
7070
let(:client) { Mysql2::EM::Client.new DatabaseCredentials['root'] }
7171
let(:error) { StandardError.new('some error') }
72-
before { client.stub(:async_result).and_raise(error) }
72+
before { allow(client).to receive(:async_result).and_raise(error) }
7373

7474
it "should swallow exceptions raised in by the client" do
7575
errors = []
@@ -85,7 +85,7 @@
8585
EM.stop_event_loop
8686
end
8787
end
88-
errors.should == [error]
88+
expect(errors).to eq([error])
8989
end
9090

9191
it "should fail the deferrable" do
@@ -105,7 +105,7 @@
105105
end
106106
end
107107
end
108-
callbacks_run.should == [:errback]
108+
expect(callbacks_run).to eq([:errback])
109109
end
110110
end
111111

@@ -121,10 +121,10 @@
121121
callbacks_run << :errback
122122
end
123123
EM.add_timer(0.1) do
124-
callbacks_run.should == [:callback]
125-
lambda {
124+
expect(callbacks_run).to eq([:callback])
125+
expect {
126126
client.close
127-
}.should_not raise_error(/invalid binding to detach/)
127+
}.not_to raise_error
128128
EM.stop_event_loop
129129
end
130130
end

0 commit comments

Comments
 (0)