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 CHANGED
@@ -15,7 +15,14 @@ tmtags
15
15
 
16
16
  ## PROJECT::GENERAL
17
17
  coverage
18
+ config
18
19
  rdoc
19
20
  pkg
21
+ log
22
+ .idea
23
+ .rvmrc
24
+ .bundle
25
+ Gemfile.lock
20
26
 
21
27
  ## PROJECT::SPECIFIC
28
+ spec/amqp.yml
data/HISTORY CHANGED
@@ -73,3 +73,7 @@
73
73
  == 0.3.4 / 2010-11-26
74
74
 
75
75
  * amqp_before/after hooks added
76
+
77
+ == 0.3.5 / 2011-01-07
78
+
79
+ * Drop-in support for legacy em-spec based examples added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
@@ -1,5 +1,5 @@
1
- require_relative 'amqp'
2
- require_relative 'evented_example'
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
+
@@ -1,4 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe '!!!!!!!!! LEAKING OR PROBLEMATIC EXAMPLES !!!!!!!!!' do
4
+ describe 'None' do
5
+
6
+ end
4
7
  end
@@ -18,7 +18,7 @@ describe 'Plain EM, no AMQP' do
18
18
  end
19
19
  end
20
20
 
21
- it "should be possible to set spec timeouts as a number of secounds" do
21
+ it "should be possible to set spec timeouts as a number of seconds" do
22
22
  start = Time.now
23
23
  expect {
24
24
  em(0.5) do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 4
9
- version: 0.3.4
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: 2010-11-26 00:00:00 +03:00
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/AMQP specs. Supports RSpec and RSpec2.
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
@@ -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