amqp-spec 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/HISTORY +4 -0
- data/VERSION +1 -1
- data/lib/amqp-spec/rspec.rb +9 -3
- data/spec/em_legacy_spec.rb +54 -0
- data/spec/problematic_rspec_spec.rb +3 -0
- data/spec/rspec_em_spec.rb +1 -1
- metadata +6 -6
- data/spec/amqp.yml +0 -28
data/.gitignore
CHANGED
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.5
|
data/lib/amqp-spec/rspec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'amqp-spec/amqp'
|
2
|
+
require 'amqp-spec/evented_example'
|
3
3
|
|
4
4
|
# You can include one of the following modules into your example groups:
|
5
5
|
# AMQP::SpecHelper,
|
@@ -207,4 +207,10 @@ module AMQP
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
end
|
210
|
-
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Monkey patching EM to provide drop-in experience for legacy EM-Spec based examples
|
213
|
+
module EventMachine
|
214
|
+
Spec = AMQP::EMSpec
|
215
|
+
SpecHelper = AMQP::SpecHelper
|
216
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Legacy EM-Spec based examples should run unmodified' do
|
4
|
+
describe EM::SpecHelper, ' when included' do
|
5
|
+
include EM::SpecHelper
|
6
|
+
|
7
|
+
it "should not require a call to done when #em is not used" do
|
8
|
+
1.should == 1
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should have timers" do
|
12
|
+
start = Time.now
|
13
|
+
em do
|
14
|
+
EM.add_timer(0.5) {
|
15
|
+
(Time.now-start).should be_close(0.5, 0.1)
|
16
|
+
done
|
17
|
+
}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should be possible to set spec timeouts as a number of seconds" do
|
22
|
+
start = Time.now
|
23
|
+
expect {
|
24
|
+
em(0.5) do
|
25
|
+
EM.add_timer(1) { done }
|
26
|
+
end
|
27
|
+
}.to raise_error SpecTimeoutExceededError
|
28
|
+
(Time.now-start).should be_close(0.5, 0.1)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should be possible to set spec timeout as an option (amqp interface compatibility)" do
|
32
|
+
start = Time.now
|
33
|
+
expect {
|
34
|
+
em(0.5) do
|
35
|
+
EM.add_timer(1) { done }
|
36
|
+
end
|
37
|
+
}.to raise_error SpecTimeoutExceededError
|
38
|
+
(Time.now-start).should be_close(0.5, 0.1)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe EM::Spec, ' when included' do
|
43
|
+
include EM::Spec
|
44
|
+
|
45
|
+
it_should_behave_like 'Spec examples'
|
46
|
+
end
|
47
|
+
|
48
|
+
describe RSPEC, " when running an example group after groups that uses EM specs " do
|
49
|
+
it "should work normally" do
|
50
|
+
:does_not_hang.should_not be_false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
data/spec/rspec_em_spec.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 5
|
9
|
+
version: 0.3.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Arvicco
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-07 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
version: 0.6.7
|
63
63
|
type: :runtime
|
64
64
|
version_requirements: *id003
|
65
|
-
description: Simple API for writing asynchronous EventMachine
|
65
|
+
description: Simple API for writing asynchronous EventMachine and AMQP specs. Runs legacy EM-Spec based examples. Supports RSpec and RSpec2.
|
66
66
|
email: arvitallian@gmail.com
|
67
67
|
executables: []
|
68
68
|
|
@@ -78,9 +78,9 @@ files:
|
|
78
78
|
- lib/amqp-spec/rspec.rb
|
79
79
|
- lib/amqp-spec.rb
|
80
80
|
- lib/version.rb
|
81
|
-
- spec/amqp.yml
|
82
81
|
- spec/em_defaults_spec.rb
|
83
82
|
- spec/em_hooks_spec.rb
|
83
|
+
- spec/em_legacy_spec.rb
|
84
84
|
- spec/em_metadata_spec.rb
|
85
85
|
- spec/failing_rspec_spec.rb
|
86
86
|
- spec/problematic_rspec_spec.rb
|
@@ -139,9 +139,9 @@ signing_key:
|
|
139
139
|
specification_version: 3
|
140
140
|
summary: Simple API for writing asynchronous EventMachine/AMQP specs. Supports RSpec and RSpec2.
|
141
141
|
test_files:
|
142
|
-
- spec/amqp.yml
|
143
142
|
- spec/em_defaults_spec.rb
|
144
143
|
- spec/em_hooks_spec.rb
|
144
|
+
- spec/em_legacy_spec.rb
|
145
145
|
- spec/em_metadata_spec.rb
|
146
146
|
- spec/failing_rspec_spec.rb
|
147
147
|
- spec/problematic_rspec_spec.rb
|
data/spec/amqp.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# AMQP client configuration file
|
2
|
-
|
3
|
-
# These values will be used to configure the ampq gem, any values
|
4
|
-
# omitted will let the gem use it's own defaults.
|
5
|
-
|
6
|
-
# The configuration specifies the following keys:
|
7
|
-
# * user - Username for the broker
|
8
|
-
# * pass - Password for the broker
|
9
|
-
# * host - Hostname where the broker is running
|
10
|
-
# * vhost - Vhost to connect to
|
11
|
-
# * port - Port where the broker is running
|
12
|
-
# * ssl - Use ssl or not
|
13
|
-
# * timeout - Timeout
|
14
|
-
|
15
|
-
defaults: &defaults
|
16
|
-
user: guest
|
17
|
-
pass: guest
|
18
|
-
host: 10.211.55.2
|
19
|
-
vhost: /
|
20
|
-
|
21
|
-
development:
|
22
|
-
<<: *defaults
|
23
|
-
|
24
|
-
test:
|
25
|
-
<<: *defaults
|
26
|
-
|
27
|
-
production:
|
28
|
-
<<: *defaults
|