em-spec 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +8 -5
- data/LICENSE +21 -0
- data/{README.rdoc → README.md} +46 -17
- data/em-spec.gemspec +7 -9
- data/lib/em-spec/test.rb +1 -1
- data/lib/em-spec/version.rb +1 -1
- metadata +117 -140
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 74e0e0a25acfe58332635850841ea9f57553c81b
|
4
|
+
data.tar.gz: d41fb2c8f0f2be5b2b7db82e5e89249ba9601e0f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: de0217a5193d8956c6d35e62909b250718b4a0e22d29ccbfcab2df01bcf69488b2fefa7d6a59ddb9c6a325bb0609eb04b27872b24c0c66033392b2103ab45b6d
|
7
|
+
data.tar.gz: d9aa3f6a70778f91f8139df12779d9008e9ee625af543952bc465013c55094b5dff24abdfa8bcadc9c1dc8a18b9f35ab2bb84ed23d4264500f90d6a37a68278d
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
em-spec (0.2.
|
5
|
-
bacon
|
4
|
+
em-spec (0.2.7)
|
6
5
|
eventmachine
|
7
|
-
rspec (> 2.6.0)
|
8
|
-
test-unit
|
9
6
|
|
10
7
|
GEM
|
11
8
|
remote: http://rubygems.org/
|
12
9
|
specs:
|
13
10
|
bacon (1.1.0)
|
14
11
|
diff-lcs (1.1.3)
|
15
|
-
eventmachine (0.
|
12
|
+
eventmachine (1.0.9.1)
|
16
13
|
growl (1.0.3)
|
17
14
|
guard (0.8.8)
|
18
15
|
thor (~> 0.14.6)
|
@@ -37,8 +34,14 @@ PLATFORMS
|
|
37
34
|
ruby
|
38
35
|
|
39
36
|
DEPENDENCIES
|
37
|
+
bacon
|
40
38
|
em-spec!
|
41
39
|
growl
|
42
40
|
guard-bundler
|
43
41
|
guard-rspec
|
44
42
|
rake (= 0.8.7)
|
43
|
+
rspec (> 2.6.0)
|
44
|
+
test-unit
|
45
|
+
|
46
|
+
BUNDLED WITH
|
47
|
+
1.10.6
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2016 @joshbuddy
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights to
|
7
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
8
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
9
|
+
so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
21
|
+
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,11 +1,17 @@
|
|
1
|
-
Simple BDD API for testing asynchronous Ruby/EventMachine code
|
2
|
-
(c) 2008 Aman Gupta (tmm1)
|
1
|
+
# Simple BDD API for testing asynchronous Ruby/EventMachine code
|
3
2
|
|
4
|
-
em-spec can be used with either bacon, test unit or rspec.
|
3
|
+
`em-spec` can be used with either bacon, test unit or rspec.
|
5
4
|
|
6
|
-
|
7
|
-
There are two ways to use the Rspec
|
5
|
+
## Rspec
|
6
|
+
There are two ways to use with the Rspec gem.
|
8
7
|
|
8
|
+
To use it as a helper, include `EM::SpecHelper` in your describe block.
|
9
|
+
You then use the `em` method to wrap your evented test code.
|
10
|
+
|
11
|
+
Inside the `em` block, you must call `done` after your expectations.
|
12
|
+
Everything works normally otherwise.
|
13
|
+
|
14
|
+
```ruby
|
9
15
|
require "em-spec/rspec"
|
10
16
|
describe EventMachine do
|
11
17
|
include EM::SpecHelper
|
@@ -25,7 +31,13 @@ There are two ways to use the Rspec extension. To use it as a helper, include E
|
|
25
31
|
end
|
26
32
|
end
|
27
33
|
end
|
28
|
-
|
34
|
+
```
|
35
|
+
|
36
|
+
The other option is to include `EM::Spec` in your describe block.
|
37
|
+
|
38
|
+
This will patch Rspec so that all of your examples run inside an `em` block automatically:
|
39
|
+
|
40
|
+
```ruby
|
29
41
|
require "em-spec/rspec"
|
30
42
|
describe EventMachine do
|
31
43
|
include EM::Spec
|
@@ -44,10 +56,14 @@ The other option is to include EM::Spec in your describe block. This will patch
|
|
44
56
|
}
|
45
57
|
end
|
46
58
|
end
|
59
|
+
```
|
60
|
+
|
61
|
+
## Bacon
|
47
62
|
|
48
|
-
|
49
|
-
|
63
|
+
The API is identical to Bacon, except that you must explicitly call `done`
|
64
|
+
after all the current behavior's assertions have been made:
|
50
65
|
|
66
|
+
```ruby
|
51
67
|
require 'em-spec/bacon'
|
52
68
|
|
53
69
|
EM.describe EventMachine do
|
@@ -75,14 +91,23 @@ The API is identical to Bacon, except that you must explicitly call 'done' after
|
|
75
91
|
end
|
76
92
|
|
77
93
|
end
|
94
|
+
```
|
95
|
+
|
96
|
+
## `Test::Unit`
|
78
97
|
|
79
|
-
|
80
|
-
There are two ways to use the Test::Unit extension. To use it as a helper, include EM::TestHelper in your test unit class. You then use the em method to wrap your evented test code. Inside the em block, you must call #done after your expectations. Everything works normally otherwise.
|
98
|
+
There are two ways to use the `Test::Unit` extension.
|
81
99
|
|
100
|
+
To use it as a helper, include `EM::TestHelper` in your test unit class.
|
101
|
+
|
102
|
+
You then use the em method to wrap your evented test code.
|
103
|
+
|
104
|
+
Inside the em block, you must call `done` after your expectations.
|
105
|
+
Everything works normally otherwise.
|
106
|
+
|
107
|
+
```ruby
|
82
108
|
require 'em-spec/test'
|
83
109
|
|
84
110
|
class EmSpecHelperTest < Test::Unit::TestCase
|
85
|
-
|
86
111
|
include EventMachine::TestHelper
|
87
112
|
|
88
113
|
def test_trivial
|
@@ -92,9 +117,14 @@ There are two ways to use the Test::Unit extension. To use it as a helper, incl
|
|
92
117
|
end
|
93
118
|
end
|
94
119
|
end
|
95
|
-
|
96
|
-
|
120
|
+
```
|
121
|
+
|
122
|
+
The other option is to include `EM::Test` in your test class.
|
123
|
+
|
124
|
+
This will patch `Test::Unit` so that all of your examples run inside an
|
125
|
+
`em` block automatically:
|
97
126
|
|
127
|
+
```ruby
|
98
128
|
require 'em-spec/test'
|
99
129
|
|
100
130
|
class EmSpecTest < Test::Unit::TestCase
|
@@ -110,9 +140,8 @@ The other option is to include EM::Test in your test class. This will patch Tes
|
|
110
140
|
}
|
111
141
|
end
|
112
142
|
end
|
143
|
+
```
|
113
144
|
|
114
|
-
Resources
|
145
|
+
## Resources
|
115
146
|
|
116
|
-
*
|
117
|
-
* Bacon: http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/30b07b651b0662fd
|
118
|
-
* Initial announcement: http://groups.google.com/group/eventmachine/browse_thread/thread/8b4e7ead72f9d013
|
147
|
+
* [Bacon](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/30b07b651b0662fd)
|
data/em-spec.gemspec
CHANGED
@@ -10,21 +10,21 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = "BDD for Ruby/EventMachine"
|
11
11
|
s.description = "Simple BDD API for testing asynchronous Ruby/EventMachine code"
|
12
12
|
s.email = %q{schmurfy@gmail.com}
|
13
|
-
s.extra_rdoc_files = ['README.rdoc']
|
14
13
|
s.files = `git ls-files`.split("\n")
|
15
|
-
s.homepage = %q{
|
16
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
14
|
+
s.homepage = %q{https://github.com/joshbuddy/em-spec}
|
17
15
|
s.require_paths = ["lib"]
|
18
16
|
s.rubygems_version = %q{1.3.7}
|
19
17
|
s.test_files = `git ls-files`.split("\n").select{|f| f =~ /^test/}
|
20
18
|
s.rubyforge_project = 'em-spec'
|
21
19
|
|
22
|
-
# dependencies
|
23
|
-
s.add_dependency 'rspec', '> 2.6.0'
|
24
|
-
s.add_dependency 'bacon'
|
25
|
-
s.add_dependency 'test-unit'
|
26
20
|
s.add_dependency 'eventmachine'
|
27
21
|
|
22
|
+
# These are not runtime dependencies since in most cases people will use
|
23
|
+
# em-spec with only one of these libraries
|
24
|
+
s.add_development_dependency 'rspec', '> 2.6.0'
|
25
|
+
s.add_development_dependency 'bacon'
|
26
|
+
s.add_development_dependency 'test-unit'
|
27
|
+
|
28
28
|
if RUBY_PLATFORM.downcase.include?("darwin")
|
29
29
|
# also install growlnotify from the
|
30
30
|
# Extras/growlnotify/growlnotify.pkg in Growl disk image
|
@@ -34,6 +34,4 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_development_dependency 'guard-rspec'
|
35
35
|
s.add_development_dependency 'guard-bundler'
|
36
36
|
s.add_development_dependency 'rake', '= 0.8.7'
|
37
|
-
|
38
37
|
end
|
39
|
-
|
data/lib/em-spec/test.rb
CHANGED
data/lib/em-spec/version.rb
CHANGED
metadata
CHANGED
@@ -1,154 +1,142 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-spec
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 6
|
10
|
-
version: 0.2.6
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.7
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Aman Gupta
|
14
8
|
- Julien Ammous
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
date: 2016-02-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: eventmachine
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
22
29
|
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.6.0
|
35
|
+
type: :development
|
23
36
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
requirements:
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
27
39
|
- - ">"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 6
|
33
|
-
- 0
|
40
|
+
- !ruby/object:Gem::Version
|
34
41
|
version: 2.6.0
|
35
|
-
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
42
|
+
- !ruby/object:Gem::Dependency
|
38
43
|
name: bacon
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
39
50
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
requirements:
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
43
53
|
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
- 0
|
48
|
-
version: "0"
|
49
|
-
type: :runtime
|
50
|
-
version_requirements: *id002
|
51
|
-
- !ruby/object:Gem::Dependency
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
52
57
|
name: test-unit
|
53
|
-
|
54
|
-
|
55
|
-
none: false
|
56
|
-
requirements:
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
57
60
|
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
- 0
|
62
|
-
version: "0"
|
63
|
-
type: :runtime
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: eventmachine
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
67
64
|
prerelease: false
|
68
|
-
|
69
|
-
|
70
|
-
requirements:
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
71
67
|
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
|
75
|
-
- 0
|
76
|
-
version: "0"
|
77
|
-
type: :runtime
|
78
|
-
version_requirements: *id004
|
79
|
-
- !ruby/object:Gem::Dependency
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
80
71
|
name: growl
|
81
|
-
|
82
|
-
|
83
|
-
none: false
|
84
|
-
requirements:
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
85
74
|
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
segments:
|
89
|
-
- 0
|
90
|
-
version: "0"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
91
77
|
type: :development
|
92
|
-
version_requirements: *id005
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: guard-rspec
|
95
78
|
prerelease: false
|
96
|
-
|
97
|
-
|
98
|
-
requirements:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
99
81
|
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: guard-rspec
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
105
91
|
type: :development
|
106
|
-
version_requirements: *id006
|
107
|
-
- !ruby/object:Gem::Dependency
|
108
|
-
name: guard-bundler
|
109
92
|
prerelease: false
|
110
|
-
|
111
|
-
|
112
|
-
requirements:
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
113
95
|
- - ">="
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: guard-bundler
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
119
105
|
type: :development
|
120
|
-
version_requirements: *id007
|
121
|
-
- !ruby/object:Gem::Dependency
|
122
|
-
name: rake
|
123
106
|
prerelease: false
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rake
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - '='
|
117
|
+
- !ruby/object:Gem::Version
|
134
118
|
version: 0.8.7
|
135
119
|
type: :development
|
136
|
-
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.8.7
|
137
126
|
description: Simple BDD API for testing asynchronous Ruby/EventMachine code
|
138
127
|
email: schmurfy@gmail.com
|
139
128
|
executables: []
|
140
|
-
|
141
129
|
extensions: []
|
142
|
-
|
143
|
-
|
144
|
-
-
|
145
|
-
|
146
|
-
- .
|
147
|
-
- .rspec
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- CHANGELOG.md
|
148
135
|
- Gemfile
|
149
136
|
- Gemfile.lock
|
150
137
|
- Guardfile
|
151
|
-
-
|
138
|
+
- LICENSE
|
139
|
+
- README.md
|
152
140
|
- Rakefile
|
153
141
|
- em-spec.gemspec
|
154
142
|
- lib/em-spec/bacon.rb
|
@@ -160,40 +148,29 @@ files:
|
|
160
148
|
- spec/rspec_spec.rb
|
161
149
|
- test/bacon_spec.rb
|
162
150
|
- test/test_spec.rb
|
163
|
-
homepage:
|
151
|
+
homepage: https://github.com/joshbuddy/em-spec
|
164
152
|
licenses: []
|
165
|
-
|
153
|
+
metadata: {}
|
166
154
|
post_install_message:
|
167
|
-
rdoc_options:
|
168
|
-
|
169
|
-
require_paths:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
170
157
|
- lib
|
171
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
-
|
173
|
-
requirements:
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
174
160
|
- - ">="
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
version: "0"
|
180
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
-
none: false
|
182
|
-
requirements:
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
183
165
|
- - ">="
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
|
186
|
-
segments:
|
187
|
-
- 0
|
188
|
-
version: "0"
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
189
168
|
requirements: []
|
190
|
-
|
191
169
|
rubyforge_project: em-spec
|
192
|
-
rubygems_version:
|
170
|
+
rubygems_version: 2.4.8
|
193
171
|
signing_key:
|
194
|
-
specification_version:
|
172
|
+
specification_version: 4
|
195
173
|
summary: BDD for Ruby/EventMachine
|
196
|
-
test_files:
|
174
|
+
test_files:
|
197
175
|
- test/bacon_spec.rb
|
198
176
|
- test/test_spec.rb
|
199
|
-
has_rdoc:
|