beanstalk-client-rspec 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ pkg/
2
+ Gemfile.lock
data/CHANGELOG.mkd ADDED
@@ -0,0 +1,19 @@
1
+ # 0.0.3 (2012-02-09)
2
+
3
+ Bugfixes
4
+ --------
5
+
6
+ * Remove Gemfile.lock from repository
7
+ * Rename flush! to reset!, since it rests all the state
8
+ * Add tests for reset!
9
+
10
+ # 0.0.2 (2012-02-09)
11
+
12
+ Bugfixes
13
+ --------
14
+
15
+ * Add flush! to MockPool and iterate over MockConnections
16
+
17
+ # 0.0.1 (2012-02-01)
18
+
19
+ Initial release.
@@ -4,8 +4,9 @@ require File.expand_path('../lib/beanstalk-client-rspec/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["John Ferlito"]
6
6
  gem.email = ["johnf@inodes.org"]
7
- gem.description = %q{Mock and RSpec for beanstalk-client}
8
- gem.summary = %q{Provides a fairly complete mock for beanstalk-client by imitating beanstalkd using arrays. Also provides some rspec matchers for testing the state of the system.}
7
+ gem.summary = %q{Mock and RSpec for beanstalk-client}
8
+ gem.description = %q{Provides a fairly complete mock for beanstalk-client by imitating beanstalkd using arrays. Also provides some rspec matchers for testing the state of the system.}
9
+ gem.license = 'MIT'
9
10
  gem.homepage = "https://github.com/johnf/beanstalk-client-rspec"
10
11
 
11
12
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  module Beanstalk
2
2
  module Client
3
3
  module Rspec
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -13,7 +13,7 @@ module Beanstalk
13
13
  end
14
14
 
15
15
  # Tests use this to rest stuff
16
- def flush!
16
+ def reset!
17
17
  initialize(nil, @default_tube)
18
18
  end
19
19
 
@@ -122,5 +122,11 @@ module Beanstalk
122
122
  end
123
123
  @connections.size
124
124
  end
125
+
126
+ def reset!
127
+ @connections.values.each do |c|
128
+ c.reset!
129
+ end
130
+ end
125
131
  end
126
132
  end
@@ -40,4 +40,23 @@ describe Beanstalk::MockPool do
40
40
  job = @beanstalk.reserve
41
41
  job.body.should == 'cow'
42
42
  end
43
+
44
+ describe 'reset!' do
45
+
46
+ it 'should empty tubes' do
47
+ @beanstalk.put 'cow'
48
+ @beanstalk.should have_tube_size_of(1).for('default')
49
+ @beanstalk.reset!
50
+ @beanstalk.should have_tube_size_of(0).for('default')
51
+ end
52
+
53
+ it 'should not be watching anything' do
54
+ @beanstalk.list_tubes_watched.values.flatten.should == ['default']
55
+ @beanstalk.watch 'foo'
56
+ @beanstalk.list_tubes_watched.values.flatten.should == ['default', 'foo']
57
+ @beanstalk.reset!
58
+ @beanstalk.list_tubes_watched.values.flatten.should == ['default']
59
+ end
60
+ end
61
+
43
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalk-client-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-04 00:00:00.000000000 Z
12
+ date: 2012-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &22384140 !ruby/object:Gem::Requirement
16
+ requirement: &20900600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *22384140
24
+ version_requirements: *20900600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: beanstalk-client
27
- requirement: &22444920 !ruby/object:Gem::Requirement
27
+ requirement: &20899760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,17 +32,19 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *22444920
36
- description: Mock and RSpec for beanstalk-client
35
+ version_requirements: *20899760
36
+ description: Provides a fairly complete mock for beanstalk-client by imitating beanstalkd
37
+ using arrays. Also provides some rspec matchers for testing the state of the system.
37
38
  email:
38
39
  - johnf@inodes.org
39
40
  executables: []
40
41
  extensions: []
41
42
  extra_rdoc_files: []
42
43
  files:
44
+ - .gitignore
43
45
  - .rspec
46
+ - CHANGELOG.mkd
44
47
  - Gemfile
45
- - Gemfile.lock
46
48
  - LICENSE
47
49
  - README.md
48
50
  - Rakefile
@@ -55,7 +57,8 @@ files:
55
57
  - spec/rspec_spec.rb
56
58
  - spec/spec_helper.rb
57
59
  homepage: https://github.com/johnf/beanstalk-client-rspec
58
- licenses: []
60
+ licenses:
61
+ - MIT
59
62
  post_install_message:
60
63
  rdoc_options: []
61
64
  require_paths:
@@ -77,7 +80,6 @@ rubyforge_project:
77
80
  rubygems_version: 1.8.11
78
81
  signing_key:
79
82
  specification_version: 3
80
- summary: Provides a fairly complete mock for beanstalk-client by imitating beanstalkd
81
- using arrays. Also provides some rspec matchers for testing the state of the system.
83
+ summary: Mock and RSpec for beanstalk-client
82
84
  test_files: []
83
85
  has_rdoc:
data/Gemfile.lock DELETED
@@ -1,26 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- beanstalk-client-rspec (0.0.1)
5
- beanstalk-client
6
- rspec
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- beanstalk-client (1.1.1)
12
- diff-lcs (1.1.3)
13
- rspec (2.8.0)
14
- rspec-core (~> 2.8.0)
15
- rspec-expectations (~> 2.8.0)
16
- rspec-mocks (~> 2.8.0)
17
- rspec-core (2.8.0)
18
- rspec-expectations (2.8.0)
19
- diff-lcs (~> 1.1.2)
20
- rspec-mocks (2.8.0)
21
-
22
- PLATFORMS
23
- ruby
24
-
25
- DEPENDENCIES
26
- beanstalk-client-rspec!