Skip to content

Example of declaring a capistrano recipe in an rspec test, running a #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions easy-deployment.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ Gem::Specification.new do |gem|

gem.add_development_dependency 'bundler'
gem.add_development_dependency 'rspec', '~> 2.0'
gem.add_development_dependency 'capistrano-spec'
end
23 changes: 23 additions & 0 deletions spec/backup_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'
require 'capistrano'

describe Easy::Deployment, "Easy Deployment backup tasks" do

before do
@config = Capistrano::Configuration.new
@config.extend(Capistrano::Spec::ConfigurationExtension)
end

it "should create a backup directory" do

@config.load do
require 'easy/deployment/backup'

set :shared_path, 'rspec'
end

@config.find_and_execute_task('easy:backup:setup')

@config.should have_run "mkdir -p rspec/backup/data"
end
end
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

require 'easy-deployment'

require 'capistrano-spec'

RSpec.configure do |config|
config.mock_with :rspec

config.include Capistrano::Spec::Matchers
config.include Capistrano::Spec::Helpers
end