capistrano-spec 0.3.3 → 0.4.0
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 +8 -8
- data/Rakefile +1 -1
- data/capistrano-spec.gemspec +2 -2
- data/lib/capistrano/spec.rb +4 -6
- data/spec/capistrano-spec_spec.rb +8 -5
- data/spec/recipe/fakerecipe.rb +12 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDU4NmVlNjQyZWFhYTZkMWIwYjMwMmQxMGI4ZGYzMGVkOWI1Y2U1Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTM0Y2VhYTdkMWVlZTZkYTgxZDE3YWM3MzIxNWNmMjUyZmRkNWFjZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGZlNjE2YzJhODU0NmZiZDFlMjg3MmMxNjdhYWZkZjM2MzMxODBlMzlhMmYz
|
10
|
+
MDRjMjE3NzlhOTIyZjVkYmM3NWY4NTIwZWYxMDU3OWJiMTk3NzVkNThlNjA5
|
11
|
+
ZDNmN2M5ZmVkZmU2ODdlNGNiNWY0OTVjNDU0ODQ1ZTU0ZjQ5ZDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzQzMDVhNjhiNDUyOTQ3YzM0YjM5NDdiY2E4ZDY2MWZhM2ZjMDA5NWRkMzU0
|
14
|
+
NmIzZmM0YThiNTI1NDgyNzE1MWQ2YTMyYzhjY2ExZGNiMDlhOGFiMmNlM2Fj
|
15
|
+
MDg1ZGY0MzUyY2IxMjFjMTEyMDkyNzk5NGExMzVhYmE4YWExYzk=
|
data/Rakefile
CHANGED
data/capistrano-spec.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "capistrano-spec"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Nichols", "Karl Matthias", "Peter M Souter", "Jan Graichen"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-05-16"
|
13
13
|
s.description = "Helpers and matchers for testing capistrano"
|
14
14
|
s.email = "josh@technicalpickles.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/capistrano/spec.rb
CHANGED
@@ -70,14 +70,12 @@ module Capistrano
|
|
70
70
|
callbacks = find_callback(configuration, @on, @task)
|
71
71
|
|
72
72
|
if callbacks
|
73
|
-
@
|
74
|
-
|
75
|
-
if @callback && @after_task_name
|
73
|
+
if @after_task_name
|
76
74
|
@after_task = configuration.find_task(@after_task_name)
|
77
|
-
|
78
|
-
elsif @
|
75
|
+
callbacks.any? { |callback| callback.applies_to?(@after_task) }
|
76
|
+
elsif @before_task_name
|
79
77
|
@before_task = configuration.find_task(@before_task_name)
|
80
|
-
|
78
|
+
callbacks.any? { |callback| callback.applies_to?(@before_task) }
|
81
79
|
else
|
82
80
|
! @callback.nil?
|
83
81
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'capistrano'
|
3
|
-
|
4
3
|
require File.expand_path('../recipe/fakerecipe', __FILE__)
|
5
4
|
|
6
5
|
describe Capistrano::Spec do
|
@@ -55,12 +54,16 @@ describe Capistrano::Spec do
|
|
55
54
|
|
56
55
|
describe 'callback' do
|
57
56
|
|
58
|
-
|
59
|
-
|
57
|
+
['fake:before_this_execute_thing', "fake:before_this_also_execute_thing"].each do |task|
|
58
|
+
it "will not raise error when `before` callback has occured for #{task}" do
|
59
|
+
fake_recipe.should callback('fake:thing').before(task)
|
60
|
+
end
|
60
61
|
end
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
['fake:after_this_execute_thing', "fake:after_this_also_execute_thing"].each do |task|
|
64
|
+
it "will not raise error when `after` callback has occured for #{task}" do
|
65
|
+
fake_recipe.should callback('fake:thing').after(task)
|
66
|
+
end
|
64
67
|
end
|
65
68
|
end
|
66
69
|
|
data/spec/recipe/fakerecipe.rb
CHANGED
@@ -3,8 +3,10 @@ require 'capistrano'
|
|
3
3
|
module Fakerecipe
|
4
4
|
def self.load_into(configuration)
|
5
5
|
configuration.load do
|
6
|
-
before "fake:
|
7
|
-
|
6
|
+
before "fake:before_this_execute_thing", "fake:thing"
|
7
|
+
before "fake:before_this_also_execute_thing", "fake:thing"
|
8
|
+
after "fake:after_this_execute_thing", "fake:thing"
|
9
|
+
after "fake:after_this_also_execute_thing", "fake:thing"
|
8
10
|
namespace :fake do
|
9
11
|
desc "thing and run fake manifests"
|
10
12
|
task :thing do
|
@@ -14,11 +16,17 @@ require 'capistrano'
|
|
14
16
|
get('/tmp/baz', 'baz')
|
15
17
|
end
|
16
18
|
desc "More fake tasks!"
|
17
|
-
task :
|
19
|
+
task :before_this_execute_thing do
|
18
20
|
#
|
19
21
|
end
|
20
22
|
desc "You get the picture..."
|
21
|
-
task :
|
23
|
+
task :before_this_also_execute_thing do
|
24
|
+
#
|
25
|
+
end
|
26
|
+
task :after_this_execute_thing do
|
27
|
+
#
|
28
|
+
end
|
29
|
+
task :after_this_also_execute_thing do
|
22
30
|
#
|
23
31
|
end
|
24
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Nichols
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|