diff --git a/spec/capistrano-ghostinspector_spec.rb b/spec/capistrano-ghostinspector_spec.rb index 851103c..2138f68 100644 --- a/spec/capistrano-ghostinspector_spec.rb +++ b/spec/capistrano-ghostinspector_spec.rb @@ -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 \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 856fcb0..f62a631 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,10 @@ require 'capistrano' -require 'capistrano-spec' \ No newline at end of file + +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 \ No newline at end of file