fantaskspec 1.0.0 → 1.1.0

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: 95147a2719acbcacaad0159ff4acea7dea919122
4
- data.tar.gz: 48c10a57ba56d6006972a97b6e8e1d1c5e31e232
3
+ metadata.gz: 635b7d95793a401854591c23050d23784abff443
4
+ data.tar.gz: 15dc8288276dc198b63087aa87180f82ddb6b75f
5
5
  SHA512:
6
- metadata.gz: ec000c3bb8daafb886c35de226d1e893e949ae29e00e05a85f01afa8291f5a332a01d9f760cfc03bdcdc8e2af71f9a9b1f0973877abe22792c930a99e6b31a54
7
- data.tar.gz: 96c174a56e631ed5c9cb5688684d15720af3f5c96df2e2176bd8a9240d1c6163da5927309dc44078b7ea0f2a706444c2adba464b13e10dae1f94ec29149b789a
6
+ metadata.gz: 7466d1203df977ae3d574c97f93f895656ed757977b36b5a5fb9b520245f20affa372f9a9834cdf09367677281bdb0fb9301991d95f92460470d8fc3e3696367
7
+ data.tar.gz: 6cd6a28b97f2d83845bd17e0d278581870dbde91293fdb2542a290818fb207914021c7aab8b387b7d27a979eea82dbb325cc358ce8afa8b88b95bbb00edc2a04
data/README.md CHANGED
@@ -56,7 +56,7 @@ We can test it like this:
56
56
  ```ruby
57
57
  require "spec_helper"
58
58
 
59
- RSpec.describe "some_task" do
59
+ RSpec.describe "namespace:taskname", type: :rake do
60
60
  it { is_expected.to depend_on(:environment) }
61
61
 
62
62
  it "executes some code" do
@@ -82,6 +82,15 @@ as long as the test is located at `spec/tasks` or `spec/lib/tasks`.
82
82
  We also have access to `task_name`, which is just the Fantaskspec's best guess at the name of the task
83
83
  we're specifying is, based on the description string we pass to `describe` or `context`.
84
84
 
85
+ `to_task_arguments`
86
+ -------------------
87
+ If your task requires arguments, just use the `to_task_arguments` helper.
88
+
89
+ ```
90
+ arguments = to_task_arguments("foo", "bar")
91
+ task.execute(arguments)
92
+ ```
93
+
85
94
  Rake testing gotchas
86
95
  --------------------
87
96
  There are 2 ways to get your Rake task's code to execute: by calling either `execute` or `invoke` on the task (or subject).
@@ -5,7 +5,7 @@ require "fantaskspec/version"
5
5
  require "fantaskspec/rake_example_group"
6
6
 
7
7
  module Fantaskspec
8
- TASK_SPEC_PATHS = [/spec\/tasks/, /spec\/lib\/tasks/]
8
+ TASK_SPEC_PATHS = [%r{spec/tasks}, %r{spec/lib/tasks}].freeze
9
9
 
10
10
  def self.initialize_configuration(config)
11
11
  config.include RakeExampleGroup, type: :rake
@@ -24,6 +24,12 @@ module Fantaskspec
24
24
 
25
25
  let(:task) { ::Rake::Task[task_name] }
26
26
  subject { task }
27
+
28
+ include(Module.new do
29
+ def to_task_arguments(*task_args)
30
+ Rake::TaskArguments.new(task.arg_names, task_args)
31
+ end
32
+ end)
27
33
  end
28
34
  end
29
35
 
@@ -1,3 +1,3 @@
1
1
  module Fantaskspec
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0".freeze
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: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Crismali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2017-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: pry
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -140,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
154
  version: '0'
141
155
  requirements: []
142
156
  rubyforge_project:
143
- rubygems_version: 2.5.1
157
+ rubygems_version: 2.6.11
144
158
  signing_key:
145
159
  specification_version: 4
146
160
  summary: Makes it easy to test your Rake tasks with RSpec.