resque_spec 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,24 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "resque_spec"
8
- gem.summary = %Q{RSpec matchers for Resque}
9
- gem.description = %Q{RSpec matchers for Resque}
10
- gem.email = "leshill@gmail.com"
11
- gem.homepage = "http://github.com/leshill/resque_spec"
12
- gem.authors = ["Les Hill"]
13
- gem.add_dependency "resque", ">= 1.6.0"
14
- gem.add_dependency "rspec", "~> 1.3.0"
15
- gem.add_development_dependency "jeweler", ">= 1.4.0"
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20
- end
21
-
22
4
  require 'spec/rake/spectask'
23
5
  Spec::Rake::SpecTask.new(:spec) do |spec|
24
6
  spec.libs << 'lib' << 'spec'
@@ -0,0 +1,3 @@
1
+ module ResqueSpec
2
+ VERSION = '0.2.2'
3
+ end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_spec
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 1
9
- version: 0.2.1
4
+ prerelease:
5
+ version: 0.2.2
10
6
  platform: ruby
11
7
  authors:
12
8
  - Les Hill
@@ -14,141 +10,47 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-11-24 00:00:00 -05:00
13
+ date: 2011-03-06 00:00:00 -05:00
18
14
  default_executable:
19
15
  dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: resque_spec
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- version: "0"
30
- type: :runtime
31
- prerelease: false
32
- version_requirements: *id001
33
16
  - !ruby/object:Gem::Dependency
34
17
  name: resque
35
- requirement: &id002 !ruby/object:Gem::Requirement
36
- none: false
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- segments:
41
- - 1
42
- - 6
43
- - 0
44
- version: 1.6.0
45
- type: :runtime
46
18
  prerelease: false
47
- version_requirements: *id002
48
- - !ruby/object:Gem::Dependency
49
- name: rspec
50
- requirement: &id003 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- segments:
56
- - 1
57
- - 3
58
- - 0
59
- version: 1.3.0
60
- type: :runtime
61
- prerelease: false
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: jeweler
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- segments:
71
- - 1
72
- - 4
73
- - 0
74
- version: 1.4.0
75
- type: :development
76
- prerelease: false
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: resque
80
- requirement: &id005 !ruby/object:Gem::Requirement
19
+ requirement: &id001 !ruby/object:Gem::Requirement
81
20
  none: false
82
21
  requirements:
83
22
  - - ">="
84
23
  - !ruby/object:Gem::Version
85
- segments:
86
- - 1
87
- - 6
88
- - 0
89
24
  version: 1.6.0
90
25
  type: :runtime
91
- prerelease: false
92
- version_requirements: *id005
26
+ version_requirements: *id001
93
27
  - !ruby/object:Gem::Dependency
94
28
  name: rspec
95
- requirement: &id006 !ruby/object:Gem::Requirement
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
96
31
  none: false
97
32
  requirements:
98
33
  - - ~>
99
34
  - !ruby/object:Gem::Version
100
- segments:
101
- - 1
102
- - 3
103
- - 0
104
35
  version: 1.3.0
105
36
  type: :runtime
106
- prerelease: false
107
- version_requirements: *id006
108
- - !ruby/object:Gem::Dependency
109
- name: jeweler
110
- requirement: &id007 !ruby/object:Gem::Requirement
111
- none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- segments:
116
- - 1
117
- - 4
118
- - 0
119
- version: 1.4.0
120
- type: :development
121
- prerelease: false
122
- version_requirements: *id007
37
+ version_requirements: *id002
123
38
  description: RSpec matchers for Resque
124
39
  email: leshill@gmail.com
125
40
  executables: []
126
41
 
127
42
  extensions: []
128
43
 
129
- extra_rdoc_files:
130
- - LICENSE
131
- - README.md
44
+ extra_rdoc_files: []
45
+
132
46
  files:
133
- - .document
134
- - .rvmrc
135
- - Gemfile
136
- - Gemfile.lock
47
+ - lib/resque_spec/resque_scheduler_spec.rb
48
+ - lib/resque_spec/resque_spec.rb
49
+ - lib/resque_spec/version.rb
50
+ - lib/resque_spec.rb
137
51
  - LICENSE
138
52
  - README.md
139
53
  - Rakefile
140
- - VERSION
141
- - lib/resque_spec.rb
142
- - lib/resque_spec/resque_scheduler_spec.rb
143
- - lib/resque_spec/resque_spec.rb
144
- - resque_spec.gemspec
145
- - spec/resque_scheduler_spec_spec.rb
146
- - spec/resque_spec_spec.rb
147
- - spec/spec.opts
148
- - spec/spec_helper.rb
149
- - spec/support/account.rb
150
- - spec/support/address.rb
151
- - spec/support/person.rb
152
54
  has_rdoc: true
153
55
  homepage: http://github.com/leshill/resque_spec
154
56
  licenses: []
@@ -163,28 +65,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
65
  requirements:
164
66
  - - ">="
165
67
  - !ruby/object:Gem::Version
166
- segments:
167
- - 0
168
68
  version: "0"
169
69
  required_rubygems_version: !ruby/object:Gem::Requirement
170
70
  none: false
171
71
  requirements:
172
72
  - - ">="
173
73
  - !ruby/object:Gem::Version
174
- segments:
175
- - 0
176
- version: "0"
74
+ version: 1.3.6
177
75
  requirements: []
178
76
 
179
77
  rubyforge_project:
180
- rubygems_version: 1.3.7
78
+ rubygems_version: 1.6.0
181
79
  signing_key:
182
80
  specification_version: 3
183
81
  summary: RSpec matchers for Resque
184
- test_files:
185
- - spec/resque_scheduler_spec_spec.rb
186
- - spec/resque_spec_spec.rb
187
- - spec/spec_helper.rb
188
- - spec/support/account.rb
189
- - spec/support/address.rb
190
- - spec/support/person.rb
82
+ test_files: []
83
+
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm gemset use resque_spec_v0_2_x
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source :rubygems
2
-
3
- gemspec
data/Gemfile.lock DELETED
@@ -1,42 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- resque_spec (0.2.1)
5
- resque (>= 1.6.0)
6
- rspec (~> 1.3.0)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- git (1.2.5)
12
- jeweler (1.5.1)
13
- bundler (~> 1.0.0)
14
- git (>= 1.2.5)
15
- rake
16
- json (1.4.6)
17
- rack (1.2.1)
18
- rake (0.8.7)
19
- redis (2.1.1)
20
- redis-namespace (0.8.0)
21
- redis (< 3.0.0)
22
- resque (1.10.0)
23
- json (~> 1.4.6)
24
- redis-namespace (~> 0.8.0)
25
- sinatra (>= 0.9.2)
26
- vegas (~> 0.1.2)
27
- rspec (1.3.1)
28
- sinatra (1.1.0)
29
- rack (~> 1.1)
30
- tilt (~> 1.1)
31
- tilt (1.1)
32
- vegas (0.1.8)
33
- rack (>= 1.0.0)
34
-
35
- PLATFORMS
36
- ruby
37
-
38
- DEPENDENCIES
39
- jeweler (>= 1.4.0)
40
- resque (>= 1.6.0)
41
- resque_spec!
42
- rspec (~> 1.3.0)
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.1
data/resque_spec.gemspec DELETED
@@ -1,72 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{resque_spec}
8
- s.version = "0.2.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Les Hill"]
12
- s.date = %q{2010-11-24}
13
- s.description = %q{RSpec matchers for Resque}
14
- s.email = %q{leshill@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.md"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rvmrc",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE",
25
- "README.md",
26
- "Rakefile",
27
- "VERSION",
28
- "lib/resque_spec.rb",
29
- "lib/resque_spec/resque_scheduler_spec.rb",
30
- "lib/resque_spec/resque_spec.rb",
31
- "resque_spec.gemspec",
32
- "spec/resque_scheduler_spec_spec.rb",
33
- "spec/resque_spec_spec.rb",
34
- "spec/spec.opts",
35
- "spec/spec_helper.rb",
36
- "spec/support/account.rb",
37
- "spec/support/address.rb",
38
- "spec/support/person.rb"
39
- ]
40
- s.homepage = %q{http://github.com/leshill/resque_spec}
41
- s.require_paths = ["lib"]
42
- s.rubygems_version = %q{1.3.7}
43
- s.summary = %q{RSpec matchers for Resque}
44
- s.test_files = [
45
- "spec/resque_scheduler_spec_spec.rb",
46
- "spec/resque_spec_spec.rb",
47
- "spec/spec_helper.rb",
48
- "spec/support/account.rb",
49
- "spec/support/address.rb",
50
- "spec/support/person.rb"
51
- ]
52
-
53
- if s.respond_to? :specification_version then
54
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
55
- s.specification_version = 3
56
-
57
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
58
- s.add_runtime_dependency(%q<resque>, [">= 1.6.0"])
59
- s.add_runtime_dependency(%q<rspec>, ["~> 1.3.0"])
60
- s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
61
- else
62
- s.add_dependency(%q<resque>, [">= 1.6.0"])
63
- s.add_dependency(%q<rspec>, ["~> 1.3.0"])
64
- s.add_dependency(%q<jeweler>, [">= 1.4.0"])
65
- end
66
- else
67
- s.add_dependency(%q<resque>, [">= 1.6.0"])
68
- s.add_dependency(%q<rspec>, ["~> 1.3.0"])
69
- s.add_dependency(%q<jeweler>, [">= 1.4.0"])
70
- end
71
- end
72
-
@@ -1,114 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "ResqueSchedulerSpec" do
4
- before do
5
- ResqueSpec.reset!
6
- end
7
-
8
- let(:first_name) { 'Les' }
9
- let(:last_name) { 'Hill' }
10
- let(:scheduled_at) { Time.now + 5 * 60 }
11
-
12
- describe "scheduled?" do
13
- it "returns true if the arguments were queued" do
14
- Resque.enqueue_at(scheduled_at, Person, first_name, last_name)
15
- ResqueSpec.scheduled?(Person, scheduled_at, first_name, last_name).should be
16
- end
17
-
18
- it "returns false if the arguments were not queued" do
19
- ResqueSpec.scheduled?(Person, scheduled_at, first_name, last_name).should_not be
20
- end
21
- end
22
-
23
- describe "scheduled_anytime?" do
24
- it "returns true if the arguments were queued" do
25
- Resque.enqueue_at(scheduled_at, Person, first_name, last_name)
26
- ResqueSpec.scheduled_anytime?(Person, first_name, last_name).should be
27
- end
28
-
29
- it "returns false if the arguments were not queued" do
30
- ResqueSpec.scheduled_anytime?(Person, first_name, last_name).should_not be
31
- end
32
- end
33
-
34
- describe "#schedule_for" do
35
- it "raises if there is no schedule queue defined for a class" do
36
- expect do
37
- ResqueSpec.schedule_for(Address)
38
- end.should raise_exception(::Resque::NoQueueError)
39
- end
40
-
41
- it "recognizes a queue defined as a class instance variable" do
42
- expect do
43
- ResqueSpec.schedule_for(Person)
44
- end.should_not raise_exception(::Resque::NoQueueError)
45
- end
46
-
47
- it "recognizes a queue defined as a class method" do
48
- expect do
49
- ResqueSpec.schedule_for(Account)
50
- end.should_not raise_exception(::Resque::NoQueueError)
51
- end
52
-
53
- it "has an empty array if nothing queued for a class" do
54
- ResqueSpec.schedule_for(Person).should == []
55
- end
56
-
57
- it "allows additions" do
58
- ResqueSpec.schedule_for(Person) << 'queued'
59
- ResqueSpec.schedule_for(Person).should_not be_empty
60
- end
61
- end
62
-
63
- describe "Resque" do
64
- describe "#enqueue_at" do
65
-
66
- before do
67
- Resque.enqueue_at(scheduled_at, Person, first_name, last_name)
68
- end
69
-
70
- it "adds to the scheduled queue hash" do
71
- ResqueSpec.schedule_for(Person).should_not be_empty
72
- end
73
-
74
- it "sets the klass on the queue" do
75
- ResqueSpec.schedule_for(Person).first.should include(:klass => Person)
76
- end
77
-
78
- it "sets the arguments on the queue" do
79
- ResqueSpec.schedule_for(Person).first.should include(:args => [first_name, last_name])
80
- end
81
-
82
- it "sets the time on the scheduled queue" do
83
- ResqueSpec.schedule_for(Person).first.should include(:time => scheduled_at)
84
- end
85
-
86
- end
87
- end
88
-
89
- context "Matchers" do
90
- before do
91
- Resque.enqueue_at(scheduled_at, Person, first_name, last_name)
92
- end
93
-
94
- describe "#have_scheduled_at" do
95
- it "returns true if the arguments are found in the queue" do
96
- Person.should have_scheduled_at(scheduled_at, first_name, last_name)
97
- end
98
-
99
- it "returns false if the arguments are not found in the queue" do
100
- Person.should_not have_scheduled_at(scheduled_at, last_name, first_name)
101
- end
102
- end
103
-
104
- describe "#have_scheduled" do
105
- it "returns true if the arguments are found in the queue" do
106
- Person.should have_scheduled(first_name, last_name)
107
- end
108
-
109
- it "returns false if the arguments are not found in the queue" do
110
- Person.should_not have_scheduled(last_name, first_name)
111
- end
112
- end
113
- end
114
- end
@@ -1,114 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "ResqueSpec" do
4
- before do
5
- ResqueSpec.reset!
6
- end
7
-
8
- let(:first_name) { 'Les' }
9
- let(:last_name) { 'Hill' }
10
-
11
- describe "#queue_for" do
12
- it "raises if there is no queue defined for a class" do
13
- expect do
14
- ResqueSpec.queue_for(Address)
15
- end.should raise_exception(::Resque::NoQueueError)
16
- end
17
-
18
- it "recognizes a queue defined as a class instance variable" do
19
- expect do
20
- ResqueSpec.queue_for(Person)
21
- end.should_not raise_exception(::Resque::NoQueueError)
22
- end
23
-
24
- it "recognizes a queue defined as a class method" do
25
- expect do
26
- ResqueSpec.queue_for(Account)
27
- end.should_not raise_exception(::Resque::NoQueueError)
28
- end
29
-
30
- it "has an empty array if nothing queued for a class" do
31
- ResqueSpec.queue_for(Person).should == []
32
- end
33
-
34
- it "allows additions" do
35
- ResqueSpec.queue_for(Person) << 'queued'
36
- ResqueSpec.queue_for(Person).should_not be_empty
37
- end
38
- end
39
-
40
- describe "#queue_name" do
41
- it "raises if there is no queue defined for a class" do
42
- expect do
43
- ResqueSpec.queue_name(Address)
44
- end.should raise_error(::Resque::NoQueueError)
45
- end
46
-
47
- it "returns the queue name if there is a queue defined as an instance var" do
48
- ResqueSpec.queue_name(Person).should == :people
49
- end
50
-
51
- it "returns the queue name if there is a queue defined via self.queue" do
52
- ResqueSpec.queue_name(Account).should == :people
53
- end
54
- end
55
-
56
- describe "#reset!" do
57
- it "clears the queues" do
58
- ResqueSpec.queue_for(Person) << 'queued'
59
- ResqueSpec.reset!
60
- ResqueSpec.queues.should be_empty
61
- end
62
- end
63
-
64
- describe "in_queue?" do
65
-
66
- it "returns true if the arguments were queued" do
67
- Resque.enqueue(Person, first_name, last_name)
68
- ResqueSpec.in_queue?(Person, first_name, last_name).should be
69
- end
70
-
71
- it "returns false if the arguments were not queued" do
72
- ResqueSpec.in_queue?(Person, first_name, last_name).should_not be
73
- end
74
-
75
- end
76
-
77
- describe "Resque" do
78
- describe "#enqueue" do
79
-
80
- before do
81
- Resque.enqueue(Person, first_name, last_name)
82
- end
83
-
84
- it "adds to the queue hash" do
85
- ResqueSpec.queue_for(Person).should_not be_empty
86
- end
87
-
88
- it "sets the klass on the queue" do
89
- ResqueSpec.queue_for(Person).first.should include(:klass => Person)
90
- end
91
-
92
- it "sets the arguments on the queue" do
93
- ResqueSpec.queue_for(Person).first.should include(:args => [first_name, last_name])
94
- end
95
-
96
- end
97
- end
98
-
99
- context "Matchers" do
100
- before do
101
- Resque.enqueue(Person, first_name, last_name)
102
- end
103
-
104
- describe "#have_queued" do
105
- it "returns true if the arguments are found in the queue" do
106
- Person.should have_queued(first_name, last_name)
107
- end
108
-
109
- it "returns false if the arguments are not found in the queue" do
110
- Person.should_not have_queued(last_name, first_name)
111
- end
112
- end
113
- end
114
- end
data/spec/spec.opts DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format nested
data/spec/spec_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'resque_spec'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
8
-
9
- Spec::Runner.configure do |config|
10
- end
@@ -1,5 +0,0 @@
1
- class Account
2
- def self.queue
3
- :people
4
- end
5
- end
@@ -1,3 +0,0 @@
1
- class Address
2
-
3
- end
@@ -1,3 +0,0 @@
1
- class Person
2
- @queue = :people
3
- end