fantaskspec 0.9.9 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 295675815beff7814ca506f1d9359b11dbb51399
4
- data.tar.gz: c2b26376d12fdac5e0bf211a90b0cd8c4c8176ff
3
+ metadata.gz: f635b1652a3a59564bd779008866255d54ad3310
4
+ data.tar.gz: 9f3e22d90d538e3ed89f62aff07263f5459d5e3b
5
5
  SHA512:
6
- metadata.gz: 1b21125fd6769c6c24ac296eba6b6452a3fc71e6d23142111b178fb6ef6e0e08aa6f4f0a1a16e1c0cb9ae380d5804294ae2bc494ddca18a898cc405966fe545c
7
- data.tar.gz: a805d791d32c45cf17a93a9aa9b0acfa3aa20582fdd0ffe239eaae573c6a623b53046b01a88eaeb3dd99d2dc8906d2ab9732605ae4f1e618e303f006fb56f80e
6
+ metadata.gz: a38dc8fb22ccd20af85dc19164f0e8ef7734306c4a872e6c5c262418d1fe3165a03e06e921c80283b4dd851c8d48e81bf4c23bf82fb316cd53f69fa02bccb458
7
+ data.tar.gz: b649e9a104d1eb41331a6e362cf18467bdfd8f07d75595eb91222a8948569b43471bdfab1ff0095ec6c7e09ffb204835c56f62d822a412db9cc766373856307a
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  Fantaskspec
2
2
  ===========
3
- Makes it easy to test your Rake tasks with RSpec.
3
+ [![Gem Version](https://badge.fury.io/rb/fantaskspec.svg)](http://badge.fury.io/rb/fantaskspec)
4
+ [![Build Status](https://travis-ci.org/crismali/fantaskspec.svg?branch=master)](https://travis-ci.org/crismali/fantaskspec)
5
+
6
+ Makes it easy to test your Rake tasks with RSpec. [Read this for more.](https://devmynd.com/blog/2015-3-testing-rake-tasks-with-rspec-and-fantaskspec)
4
7
 
5
8
  Installation
6
9
  ------------
@@ -13,11 +16,13 @@ gem "fantaskspec"
13
16
 
14
17
  And then execute:
15
18
 
16
- $ bundle
19
+ $ bundle install
17
20
 
18
- Then whereever you're configuring RSpec (`spec_helper`, `rails_helper`, whatever):
21
+ Then in your `spec_helper` or `rails_helper`:
19
22
 
20
23
  ```ruby
24
+ require "fantaskspec"
25
+
21
26
  RSpec.configure do |config|
22
27
  # ...
23
28
  config.infer_rake_task_specs_from_file_location!
@@ -25,7 +30,14 @@ RSpec.configure do |config|
25
30
  end
26
31
  ```
27
32
  That will make it so that specs in `spec/lib/tasks` and `spec/tasks` will automatically have a type
28
- of `:rake` (unless you override it).
33
+ of `:rake` (unless you override it). If you don't want to use `infer_rake_task_specs_from_file_location!`
34
+ you can explicitly set the spec type like so:
35
+
36
+ ```ruby
37
+ RSpec.describe "namespace:foo", type: :rake do
38
+ # Lots of lovely specs
39
+ end
40
+ ```
29
41
 
30
42
  ### Loading your Rake tasks
31
43
  This gem doesn't load your Rake tasks for you, that's something you have to do. If you're using Rails, just
@@ -59,8 +71,9 @@ RSpec.describe "some_task" do
59
71
  end
60
72
  end
61
73
  ```
62
- Here `subject` and `task` are both our Rake task called `some_task`. Fantaskspec gives
63
- us a handy `depend_on` matcher so we can ensure are dependencies are correct.
74
+ Here `subject` and `task` are both the Rake task `some_task`. Fantaskspec also gives us the handy `depend_on` matcher so we can ensure our dependencies are correct.
75
+
76
+ If you only care about some of your task's dependencies you can use `depend_on_subset` instead of `depend_on`.
64
77
 
65
78
  Here we're assuming we've called `config.infer_rake_task_specs_from_file_location!` in our
66
79
  `RSpec.configure` block so we don't need to specify `type: :rake` in any of our example groups
@@ -80,7 +93,12 @@ Contributing
80
93
  ------------
81
94
 
82
95
  1. [Fork it](https://github.com/crismali/fantaskspec/fork)
83
- 2. Create your feature branch (`git checkout -b my-new-feature`)
84
- 3. Commit your changes (`git commit -am 'Add some feature'`)
85
- 4. Push to the branch (`git push origin my-new-feature`)
86
- 5. Create a new Pull Request
96
+ 2. Clone it locally
97
+ 3. `cd` into the project root
98
+ 4. `bundle install`
99
+ 5. `appraisal install`
100
+ 6. Run the specs with `appraisal rspec`
101
+ 7. Create your feature branch (`git checkout -b my-new-feature`)
102
+ 8. Commit your changes (`git commit -am 'Add some feature'`)
103
+ 9. Push to the branch (`git push origin my-new-feature`)
104
+ 10. Create a new Pull Request
@@ -22,9 +22,8 @@ module Fantaskspec
22
22
  name
23
23
  end
24
24
 
25
- fetch_task = proc { ::Rake::Task[task_name] }
26
- subject(&fetch_task)
27
- let(:task, &fetch_task)
25
+ let(:task) { ::Rake::Task[task_name] }
26
+ subject { task }
28
27
  end
29
28
  end
30
29
 
@@ -33,5 +32,11 @@ module Fantaskspec
33
32
  actual.prerequisites == expected.map(&:to_s)
34
33
  end
35
34
  end
35
+
36
+ matcher :depend_on_subset do |*expected|
37
+ match do |actual|
38
+ (actual.prerequisites & expected.map(&:to_s)) == expected.map(&:to_s)
39
+ end
40
+ end
36
41
  end
37
42
  end
@@ -1,3 +1,3 @@
1
1
  module Fantaskspec
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fantaskspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Crismali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-28 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,6 +80,34 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry-doc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: appraisal
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: Makes it easy to test your Rake tasks with RSpec.
84
112
  email:
85
113
  - michael.crismali@gmail.com
@@ -112,8 +140,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
140
  version: '0'
113
141
  requirements: []
114
142
  rubyforge_project:
115
- rubygems_version: 2.2.2
143
+ rubygems_version: 2.4.5
116
144
  signing_key:
117
145
  specification_version: 4
118
146
  summary: Makes it easy to test your Rake tasks with RSpec.
119
147
  test_files: []
148
+ has_rdoc: