Sha256: d5daf6a331ee373dbcd48bd7c2d490c593c9f58c661f0bd9903bd012c152cf95

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

require "librarian"

module Librarian
  module Source
    describe Git do

      let(:env) { Environment.new }

      describe "validating options for the specfile" do

        context "with only known options" do
          it "should not raise" do
            expect { described_class.from_spec_args(env, "some://git/repo.git", :ref => "megapatches") }.
              to_not raise_error
          end
        end

        context "with an unknown option" do
          it "should raise" do
            expect { described_class.from_spec_args(env, "some://git/repo.git", :I_am_unknown => "megapatches") }.
              to raise_error Error, "unrecognized options: I_am_unknown"
          end
        end

        context "with invalid options" do
          it "should raise" do
            expect { described_class.from_spec_args(env, "some://git/repo.git", {:ref => "megapatches", :branch => "megapatches"}) }.
              to raise_error Error, "at some://git/repo.git, use only one of ref, branch, tag, or commit"
          end
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
librarianp-1.1.2 spec/unit/source/git_spec.rb
librarianp-1.1.1 spec/unit/source/git_spec.rb
librarianp-1.1.0 spec/unit/source/git_spec.rb
librarianp-1.0.0 spec/unit/source/git_spec.rb
librarianp-0.6.4 spec/unit/source/git_spec.rb