README.rdoc in capistrano-spec-0.2.0 vs README.rdoc in capistrano-spec-0.2.1
- old
+ new
@@ -122,16 +122,39 @@
it "should have gotten" do
@configuration.get '/tmp/bar', 'bar'
@configuration.should have_gotten('/tmp/bar').to('bar')
end
+You also test [callbacks](http://rubydoc.info/github/capistrano/capistrano/master/Capistrano/Configuration/Callbacks) to see if your tasks are being called at the right time:
+
+ require 'capistrano'
+ module Capistrano
+ module Speak
+ def self.load_into(configuration)
+ configuration.load do
+ before "deploy:finalize_update", "foo:bar"
+ namespace :foo do
+ task :bar do
+ set :message, 'before finalize'
+ puts message
+ end
+ end
+ end
+ end
+ end
+ end
+
+ it "performs foo:bar before deploy:finalize_update" do
+ @configuration.should callback('foo:bar').before('deploy:finalize_update')
+ end
+
== Real world examples
* [capistrano-mountaintop](https://github.com/technicalpickles/capistrano-mountaintop/blob/master/spec/capistrano-mountaintop_spec.rb)
* [moonshine](https://github.com/railsmachine/moonshine/blob/master/spec/moonshine/capistrano_integration_spec.rb)
== Note on Patches/Pull Requests
-
+
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a future version unintentionally.
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.