Sha256: 1f61b43f129f6d3b7373159eab9349a1a015a2201158a500d503ac7f96cdabcc

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 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 '#url' 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.url.should eq(
              "http://relishapp.com/pushes?project_id=rspec&api_token=abc"
            )
          end
        end
        
        context 'with version' do
          let(:push) { described_class.new(['--version', 'one']) }
          
          specify do
            push.url.should eq(
              "http://relishapp.com/pushes?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.2 spec/relish/commands/push_spec.rb