Sha256: 3f24abcfc3d204407fc35debb03b0a4b8db0aae31e3992bb9c9ad57dce89ddbe

Contents?: true

Size: 1.97 KB

Versions: 47

Compression:

Stored size: 1.97 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

module Pod
  describe SpecBuilder do
    def compare_attributes(first_spec, second_spec, attribute_name)
      first_spec.attributes_hash[attribute_name].should ==
        second_spec.attributes_hash[attribute_name]

      %w(ios osx).each do |platform|
        first_spec.attributes_hash[platform][attribute_name].should ==
          second_spec.attributes_hash[platform][attribute_name]
      end
    end

    def specification_from_builder(builder)
      spec_string = builder.spec_metadata
      spec_string += builder.spec_platform(Platform.ios)
      spec_string += builder.spec_platform(Platform.osx)
      spec_string += builder.spec_close

      return Specification.from_string(spec_string, 'Builder.podspec')
    end

    describe 'Preserve attributes from source specification' do
      before do
        @spec = Specification.from_file('spec/fixtures/Builder.podspec')
        @builder = SpecBuilder.new(@spec, nil, false, nil)
      end

      it "preserves platform.frameworks" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'frameworks')
      end

      it "preserves platform.weak_frameworks" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'weak_frameworks')
      end

      it "preserves platform.libraries" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'libraries')
      end

      it "preserves platform.requires_arc" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'requires_arc')
      end

      it "preserves platform.deployment_target" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'deployment_target')
      end

      it "preserves platform.xcconfig" do
        spec = specification_from_builder(@builder)
        compare_attributes(spec, @spec, 'xcconfig')
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 12 rubygems

Version Path
cocoapods-packager-tj-1.5.0 spec/specification/spec_builder_spec.rb
cocoapods-panglePackager-1.5.0.2 spec/specification/spec_builder_spec.rb
cocoapods-panglePackager-1.5.0.1 spec/specification/spec_builder_spec.rb
cocoapods-fanQiePackager-1.5.0.1 spec/specification/spec_builder_spec.rb
cocoapods-packager-m-1.6.4 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.13 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.12 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.11 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.10 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.9 spec/specification/spec_builder_spec.rb
cocoapods-packager-hira-1.5.6 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.7 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.6 spec/specification/spec_builder_spec.rb
cocoapods-xzpackager-1.0.2 spec/specification/spec_builder_spec.rb
cocoapods-xzpackager-1.0.1 spec/specification/spec_builder_spec.rb
cocoapods-xzpackager-1.0.0 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.5 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.4 spec/specification/spec_builder_spec.rb
ty-cocoapods-packager-1.5.3 spec/specification/spec_builder_spec.rb
cocoapods-packager-pro-1.5.4 spec/specification/spec_builder_spec.rb