Sha256: d8cf0969ccabdd8043ae558fc6d57ebf979bb08b27cee1d0f730331c3c65c9dc

Contents?: true

Size: 1.19 KB

Versions: 16

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Cany::Recipes::Bundler::Gem do
  let(:gem_name) { :bundler }
  subject { described_class.get gem_name }
  context '#get' do
    it 'should return always the same instance per gem' do
      should be_instance_of described_class
      expect(subject).to eq described_class.get gem_name
    end

    it 'should return different instances for different gems' do
      should_not eq described_class.get :bundler2
    end

    context 'returned gem instance' do
      context '\s gem_name' do
        subject { super().name }
        it { eq gem_name }
      end

      context '\' dependencies' do
        subject { super().dependencies }
        it 'should be empty per default' do
          should match_array []
        end
      end
    end
  end

  context '#specify' do
    subject { super().dependencies.first }
    let(:default) { subject.determine(:a, :b).first }
    context 'with added dependencies' do
      before do
        described_class.specify gem_name do
          depend 'hans_otto'
        end
      end
      it 'should added as runtime dependencies' do
        should be_runtime
        expect(default).to match_array [ 'hans_otto', nil]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cany-0.5.7 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.6 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.5 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.4 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.3 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.2 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.1 spec/cany/recipes/bundler/gem_spec.rb
cany-0.5.0 spec/cany/recipes/bundler/gem_spec.rb
cany-0.4.0 spec/cany/recipes/bundler/gem_spec.rb
cany-0.3.0 spec/cany/recipes/bundler/gem_spec.rb
cany-0.2.1 spec/cany/recipes/bundler/gem_spec.rb
cany-0.2.0 spec/cany/recipes/bundler/gem_spec.rb
cany-0.1.3 spec/cany/recipes/bundler/gem_spec.rb
cany-0.1.2 spec/cany/recipes/bundler/gem_spec.rb
cany-0.1.1 spec/cany/recipes/bundler/gem_spec.rb
cany-0.1.0 spec/cany/recipes/bundler/gem_spec.rb