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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTkzNTBlOGEzZjQyNzRlNDFmNTE4ODdmZjczZTA2MDAwY2E2N2EzYw==
4
+ NDU4NmVlNjQyZWFhYTZkMWIwYjMwMmQxMGI4ZGYzMGVkOWI1Y2U1Ng==
5
5
  data.tar.gz: !binary |-
6
- YzRkMzU0NjFiZjlhNzRiYTJjNGNjZjJiMjZhODhkMzU3OGIyZTQzZA==
6
+ ZTM0Y2VhYTdkMWVlZTZkYTgxZDE3YWM3MzIxNWNmMjUyZmRkNWFjZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTE1ODc4YWM4NmIzM2E3ZTllZjUwZDQ0YWM3OTgxMmM1MjkxY2JiNWEyMjkw
10
- YjVkZDQ5NDQ3OTI4MWY5MGVhOTU0YjcwNDBhN2YzN2I3Y2M3Y2JkMWE0Y2Nl
11
- ZGMyOTQ5Y2Y2OTI4YjdkNzkxODE4ODg5NDVhNDZlNzlhNjZiZjY=
9
+ OGZlNjE2YzJhODU0NmZiZDFlMjg3MmMxNjdhYWZkZjM2MzMxODBlMzlhMmYz
10
+ MDRjMjE3NzlhOTIyZjVkYmM3NWY4NTIwZWYxMDU3OWJiMTk3NzVkNThlNjA5
11
+ ZDNmN2M5ZmVkZmU2ODdlNGNiNWY0OTVjNDU0ODQ1ZTU0ZjQ5ZDQ=
12
12
  data.tar.gz: !binary |-
13
- YTEzY2MwYjcwOTYwMTBlZTM5MWI1ZWYzYjJkNjhhZTliOGVmYjQzMGJhODMw
14
- NmRiYmMwOTFiOGQ3MDA3OGI4OGQ1ZGZiMmNiOWQ4YzA3N2E4NzFhOGJjNmFj
15
- YzFmNDAxM2JjNDJjNjhkYzEzNDIyNzZkYzYwOWY4MmNkOWFhMjg=
13
+ NzQzMDVhNjhiNDUyOTQ3YzM0YjM5NDdiY2E4ZDY2MWZhM2ZjMDA5NWRkMzU0
14
+ NmIzZmM0YThiNTI1NDgyNzE1MWQ2YTMyYzhjY2ExZGNiMDlhOGFiMmNlM2Fj
15
+ MDg1ZGY0MzUyY2IxMjFjMTEyMDkyNzk5NGExMzVhYmE4YWExYzk=
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "capistrano-spec"
8
- gem.version = '0.3.3'
8
+ gem.version = '0.4.0'
9
9
 
10
10
  gem.summary = %Q{Test your capistrano recipes}
11
11
  gem.description = %Q{Helpers and matchers for testing capistrano}
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capistrano-spec"
8
- s.version = "0.3.3"
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-04-22"
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 = [
@@ -70,14 +70,12 @@ module Capistrano
70
70
  callbacks = find_callback(configuration, @on, @task)
71
71
 
72
72
  if callbacks
73
- @callback = callbacks.first
74
-
75
- if @callback && @after_task_name
73
+ if @after_task_name
76
74
  @after_task = configuration.find_task(@after_task_name)
77
- @callback.applies_to?(@after_task)
78
- elsif @callback && @before_task_name
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
- @callback.applies_to?(@before_task)
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
- it "will not raise error when `before` callback has occured" do
59
- expect{ should callback('fake:thing').before('fake:stuff_and_things')}.to_not raise_error(RSpec::Expectations::ExpectationNotMetError, /expected configuration to callback .*\s* before .*\s*, but did not/)
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
- it "will not raise error when `after` callback has occured" do
63
- expect{ should callback('fake:other_thing').after('fake:thing')}.to_not raise_error(RSpec::Expectations::ExpectationNotMetError, /expected configuration to callback .*\s* after .*\s*, but did not/)
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
 
@@ -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:stuff_and_things", "fake:thing"
7
- after "fake:thing", "fake:other_thing"
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 :other_thing do
19
+ task :before_this_execute_thing do
18
20
  #
19
21
  end
20
22
  desc "You get the picture..."
21
- task :stuff_and_things do
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.3.3
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-04-22 00:00:00.000000000 Z
14
+ date: 2013-05-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec