Sha256: bc722c95946a3e6017039907011720643f54b008a5ed2604c3d705f4e0cf4cc4

Contents?: true

Size: 1.29 KB

Versions: 11

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe '$ blazing update' do

    before :each do
      setup_sandbox
      @config = Blazing::Config.new
      @config.target :production, "#{@sandbox_directory}/target"
      @config.target :staging, "#{@sandbox_directory}/staging"
      @cli = Blazing::CLI.new
      Blazing::Config.stub(:parse).and_return @config
    end

    after :each do
      teardown_sandbox
    end

   context 'when a target is specified' do

     before :each do
       capture(:stdout, :stderr) { @cli.setup(:production) }
       capture(:stdout, :stderr) { @cli.update(:production) }
     end

     it 'generates a post-receive hook based on the current blazing config' do
       File.exists?("/tmp/post-receive").should be true
     end

     it 'copies the generated post-receive hook to the target' do
       File.exists?("#{@sandbox_directory}/target/.git/hooks/post-receive").should be true
     end
   end

   context 'when all is specified as target' do
     it 'updates all targets' do
       capture(:stdout, :stderr) { @cli.setup('all') }
       capture(:stdout, :stderr) { @cli.update('all') }
       File.exists?("#{@sandbox_directory}/target/.git/hooks/post-receive").should be true
       File.exists?("#{@sandbox_directory}/staging/.git/hooks/post-receive").should be true
     end
   end
 end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blazing-0.4.2 spec/blazing/integration/update_spec.rb
blazing-0.4.1 spec/blazing/integration/update_spec.rb
blazing-0.4.0 spec/blazing/integration/update_spec.rb
blazing-0.4.0.beta3 spec/blazing/integration/update_spec.rb
blazing-0.4.0.beta2 spec/blazing/integration/update_spec.rb
blazing-0.4.0.beta1 spec/blazing/integration/update_spec.rb
blazing-0.3.0 spec/blazing/integration/update_spec.rb
blazing-0.2.14 spec/blazing/integration/update_spec.rb
blazing-0.2.13 spec/blazing/integration/update_spec.rb
blazing-0.2.12 spec/blazing/integration/update_spec.rb
blazing-0.2.11 spec/blazing/integration/update_spec.rb