rspec-activejob 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c1afc7028b16dadcb519b091b45d61a924f202e
4
- data.tar.gz: adf02e56d10b8b7a516cbd3669428b383b34ca91
3
+ metadata.gz: 88c1648df6c71008bec37d636f453239f8b32528
4
+ data.tar.gz: 7007b7ad633537d0a2e7d2e0e6842db92babf40b
5
5
  SHA512:
6
- metadata.gz: 3fac8ed0f59bb88a0581f6e3f8c79ec5455d9d839238713e81b6f6cfe07c95211af2172931baa0bdc2744215fac923cdfbbdf9c47fd2055b1edb2103fa848a2c
7
- data.tar.gz: b6bdb4aee4574375636569e68613db1e047ac5fdc357c773adb6cce1e9cfe15b5418879004702b207f5c123ca2970140745d3cdc89a70cfe359d5bbcae9cf5b4
6
+ metadata.gz: 752a896cd5bb286546514d5d96f2277877e98238a6979f4540c8787be59b6ea3ce7476b2c8df4d16ece2086c3cf53cf21d301972e74a19418c91042e5018423a
7
+ data.tar.gz: 8a8712194227772f71ebc15be8a82bf33356333949b64930b3572088920202884d3423eb3e75e55ef989e1fb248c2e3cbb833079961cef28e5df92bad1999fa2
@@ -1,3 +1,7 @@
1
+ ## 0.4.2 - August 19, 2015
2
+
3
+ - Improve `failure_message_negated` - patch by [@swastik](https://github.com/swastik)
4
+
1
5
  ## 0.4.1 - May 5, 2015
2
6
 
3
7
  - Added `failure_message_negated` for nice failure messages when a `to_not` fails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-activejob (0.4.1)
4
+ rspec-activejob (0.4.2)
5
5
  activejob (>= 4.2)
6
6
  rspec-mocks
7
7
 
@@ -59,3 +59,6 @@ DEPENDENCIES
59
59
  rspec
60
60
  rspec-activejob!
61
61
  rspec-its
62
+
63
+ BUNDLED WITH
64
+ 1.10.6
data/README.md CHANGED
@@ -1,3 +1,18 @@
1
+ # Instalation
2
+
3
+ ```gem install rspec-activejob ```
4
+
5
+ Or add it to the Gemfile into the :development and :test group
6
+
7
+ ```ruby
8
+ # Gemfile
9
+ group :development, :test do
10
+ ...
11
+ gem 'rspec-activejob'
12
+ ...
13
+ end
14
+ ```
15
+
1
16
  # RSpec ActiveJob matchers
2
17
 
3
18
  ```ruby
@@ -24,6 +39,10 @@ RSpec.describe MyController do
24
39
  subject(:make_request) { described_class.make_request(params) }
25
40
 
26
41
  specify { expect { make_request }.to enqueue_a(RequestMaker).with(global_id(user)) }
42
+
43
+ # or
44
+ make_request
45
+ expect(RequestMaker).to have_been_enqueued.with(global_id(user))
27
46
  end
28
47
  ```
29
48
 
@@ -32,12 +51,14 @@ test adapter. The test adapter included in ActiveJob 4.2.0 does not fully serial
32
51
  will not need to use the GlobalID matcher unless you're using ActiveJob 4.2.1. See rails/rails#18266 for
33
52
  the improved test adapter.
34
53
 
35
- This gem defines three matchers:
54
+ This gem defines four matchers:
36
55
 
37
56
  * `enqueue_a`: for a block or proc, expects that to enqueue an job to the ActiveJob test adapter. Optionally
38
57
  takes the job class as its argument, and can be modified with a `.with(*args)` call to expect specific arguments.
39
58
  This will use the same argument list matcher as rspec-mocks' `receive(:message).with(*args)` matcher.
40
59
 
60
+ * `have_been_enqueued`: expects to have enqueued an job in the ActiveJob test adapter. Can be modified with a `.with(*args)` call to expect specific arguments. This will use the same argument list matcher as rspec-mocks' `receive(:message).with(*args)` matcher.
61
+
41
62
  * `global_id(model_or_class)`: an argument matcher, matching ActiveJob-serialized versions of model classes or
42
63
  specific models (or any other class which implements `to_global_id`). If you pass a model class, it will match
43
64
  the serialized version of any instance of that model; if you pass an instance, it will expect the serialized
@@ -42,7 +42,7 @@ module RSpec
42
42
  "#{new_jobs_with_correct_class.first[:args]}"
43
43
  end
44
44
 
45
- def failure_message_negated
45
+ def failure_message_when_negated
46
46
  return "expected to not enqueue a job" unless job_class
47
47
 
48
48
  message = "expected to not enqueue a #{job_class}"
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module ActiveJob
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '0.4.2'.freeze
4
4
  end
5
5
  end
@@ -32,7 +32,7 @@ RSpec.describe RSpec::ActiveJob::Matchers::EnqueueA do
32
32
 
33
33
  specify do
34
34
  matches?
35
- expect(instance.failure_message_negated).
35
+ expect(instance.failure_message_when_negated).
36
36
  to eq("expected to not enqueue a job")
37
37
  end
38
38
 
@@ -53,7 +53,7 @@ RSpec.describe RSpec::ActiveJob::Matchers::EnqueueA do
53
53
  it { is_expected.to be(true) }
54
54
  specify do
55
55
  matches?
56
- expect(instance.failure_message_negated).
56
+ expect(instance.failure_message_when_negated).
57
57
  to eq("expected to not enqueue a AJob, but enqueued a AJob with []")
58
58
  end
59
59
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-activejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Seymour
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-mocks
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-its
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: |2
@@ -90,9 +90,9 @@ executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
- - .gitignore
94
- - .rubocop.yml
95
- - .rubocop_todo.yml
93
+ - ".gitignore"
94
+ - ".rubocop.yml"
95
+ - ".rubocop_todo.yml"
96
96
  - CHANGELOG.md
97
97
  - Gemfile
98
98
  - Gemfile.lock
@@ -117,12 +117,12 @@ require_paths:
117
117
  - lib
118
118
  required_ruby_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []