Sha256: a5f77669df590ddbb94c12e3d7e9a66eb99afa0ac82ad061b78598b4fd137877

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

require 'spec_helper'

module Relish
  module Command
    describe Push do
      
      describe '#default' do
        let(:push) { described_class.new }
        
        it 'calls #run' do
          push.should_receive(:run)
          push.default
        end
      end
      
      describe '#parameters' do
        before do
          push.should_receive(:project).and_return('rspec')
          push.should_receive(:api_token).and_return('abc')
        end
        
        context 'without version' do 
          let(:push) { described_class.new }
          
          specify do
            push.parameters.should eq(
              "project_id=rspec&api_token=abc"
            )
          end
        end
        
        context 'with version' do
          let(:push) { described_class.new(['--version', 'one']) }
          
          specify do
            push.parameters.should eq(
              "project_id=rspec&version_id=one&api_token=abc"
            )
          end
        end
      end
      
      describe '#version' do
        context 'with --version in @options' do
          let(:push) { described_class.new(['--version', 'one']) }
          specify { push.version.should eq('one') }
        end
        
        context 'with --version not in @options' do
          let(:push) { described_class.new }
          specify { push.version.should be_nil }
        end
      end
      
      describe '#files_as_tar_gz' do
        let(:push) { described_class.new }
        specify { expect { push.files_as_tar_gz }.to_not raise_exception }
        specify { push.files_as_tar_gz.should be_a(String) }
      end
      
      describe '#files' do
        let(:push) { described_class.new }
        specify { expect { push.files }.to_not raise_exception }
        specify { push.files.should be_a(Array) }
      end
      
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
relish-0.0.6 spec/relish/commands/push_spec.rb