File: git_spec.rb

package info (click to toggle)
ruby-librarian 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 624 kB
  • sloc: ruby: 6,109; makefile: 11
file content (35 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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