Skip to content

Commit

Permalink
Update RSpecs to be simplier
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Richardson committed Oct 17, 2015
1 parent f0195ee commit f80e7d5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
35 changes: 19 additions & 16 deletions spec/capistrano-ghostinspector_spec.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
require 'spec_helper'
require 'capistrano'

describe Richdynamix::Ghostinspector, "loaded into a configuration" do
before do
@configuration = Capistrano::Configuration.new
Richdynamix::Ghostinspector.load_into(@configuration)
@configuration.set :gitest, 'home'
end
describe "Ghostinspector" do
before do
@configuration = Capistrano::Configuration.new
@configuration.extend(Capistrano::Spec::ConfigurationExtension)

Capistrano::Ghostinspector.load_into(@configuration)
end

describe 'run' do
subject { @configuration }

it "should define tests" do
context "when running capistrano:ghostinspector:run" do
before do
@configuration.set :gitest, 'home'
end

it "it should define tests" do
@configuration.fetch(:gitest).should == 'home'
end

end

before do
@configuration.set :gitest, 'home'
end
end






it "performs richdynamix:ghostinspector:run after deploy" do
@configuration.should callback('richdynamix:ghostinspector:run').after('deploy')
end

end
10 changes: 9 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
require 'capistrano'
require 'capistrano-spec'

require 'capistrano-spec'
require 'rspec'

# Add capistrano-spec matchers and helpers to RSpec
RSpec.configure do |config|
config.include Capistrano::Spec::Matchers
config.include Capistrano::Spec::Helpers
end

0 comments on commit f80e7d5

Please sign in to comment.