Sha256: 4745c5f1247030f7af0cd6a2ccb1466a526778b0d9210a28529c0faaad4afded

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

# Polisher Upstream Spec
#
# Licensed under the MIT license
# Copyright (C) 2013-2014 Red Hat, Inc.

require 'polisher/upstream'

module Polisher
  describe Upstream do
    describe "#parse" do
      context "gem specified" do
        it "uses Polisher::Gem to parse gem" do
          path = "/foo.gem"
          gem  = Polisher::Gem.new
          Polisher::Gem.should_receive(:parse).with(:gem => path).and_return(gem)
          Polisher::Upstream.parse(path).should == gem
        end
      end

      context "gem spec specified" do
        it "uses Polisher::Gem to parse gemspec" do
          path = "/foo.gemspec"
          gem  = Polisher::Gem.new
          Polisher::Gem.should_receive(:parse).with(:gemspec => path).and_return(gem)
          Polisher::Upstream.parse(path).should == gem
        end
      end

      context "gemfile specified" do
        it "uses Polisher::GemFile to parse gemfile" do
          path = "/Gemfile"
          gemfile  = Polisher::Gemfile.new
          Polisher::Gemfile.should_receive(:parse).with(path).and_return(gemfile)
          Polisher::Upstream.parse(path).should == gemfile
        end
      end
    end
  end # describe Gemfile
end # module Polisher

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polisher-0.10.2 spec/upstream_spec.rb
polisher-0.10.1 spec/upstream_spec.rb
polisher-0.9.1 spec/upstream_spec.rb
polisher-0.8.1 spec/upstream_spec.rb
polisher-0.7.1 spec/upstream_spec.rb