derelict 0.6.1.travis.147 → 0.6.1.travis.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/derelict/parser/box_list.rb +2 -1
- data/spec/derelict/parser/box_list_spec.rb +17 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTBiM2Y4OGEwZWQyMjljMDAxYjZhYmFkYWQ3NTU5NTFkZjg2YjM5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGZiNWEzMWNhYzcwYTU5YTE4ZThiYjA4ODhmZTg1NGIwYjIyYzM3Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDgzYzY1NjQ0MWNiNGU0YjE5NWM2MmNjY2VhNTEwNDZmYmIzN2M5NWIzODY2
|
10
|
+
YWE1ZjNiNjQxMGZiNTkzNDE2ZWIxNGI2YzFlZTQ5YzVmOGNkNmMxMjM1YjYx
|
11
|
+
MDY0YmQ0NmFiMDY1MmFjOWE5ZThkYzQxZjJhZGY4OTdkMDk5NjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWQyNDJkMjZlZjNhNDViN2JhZDI0ZWJlOTg0OWJlODdkYTRhMjM5YWMwZjMw
|
14
|
+
YmY5YzljMGUyZjRiMDdjZGIwMmIwMDkwM2NiZTU3MWJhN2YxMjJjZWNjMWJl
|
15
|
+
MDljNTViY2RjMjhkMTk0ODkwZTA4YTQ3ZTYwNmE3ODEwYjA2ZmQ=
|
@@ -20,7 +20,8 @@ module Derelict
|
|
20
20
|
PARSE_BOX = %r[
|
21
21
|
^(.*?) # Box name starts at the start of the line
|
22
22
|
\ +\( # Provider is separated by spaces and open-parenthesis
|
23
|
-
(
|
23
|
+
(\w+) # Provider name
|
24
|
+
(:?,.+)? # Version, ignored
|
24
25
|
\)$ # Ends with close-parenthesis and end-of-line
|
25
26
|
]x # Ignore whitespace to allow these comments
|
26
27
|
|
@@ -27,18 +27,27 @@ describe Derelict::Parser::BoxList do
|
|
27
27
|
let(:foobar) { Derelict::Box.new "foobar", "provider_one" }
|
28
28
|
let(:baz) { Derelict::Box.new "baz", "provider_two" }
|
29
29
|
it { should eq Set[foobar, baz] }
|
30
|
+
|
31
|
+
context "with versioned boxes" do
|
32
|
+
let(:output) { "qux (foo, 0)" }
|
33
|
+
let(:qux) { Derelict::Box.new "qux", "foo" }
|
34
|
+
it { should eq Set[qux] }
|
35
|
+
end
|
30
36
|
end
|
31
37
|
|
32
38
|
context "with invalid output" do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
context "with text after brackets" do
|
40
|
+
let(:output) { "foobar (provider_one) lolwut" }
|
41
|
+
it "should raise InvalidFormat" do
|
42
|
+
expect { subject }.to raise_error Derelict::Parser::BoxList::InvalidFormat
|
43
|
+
end
|
44
|
+
end
|
39
45
|
|
40
|
-
|
41
|
-
|
46
|
+
context "with no brackets" do
|
47
|
+
let(:output) { "baz with no brackets" }
|
48
|
+
it "should raise InvalidFormat" do
|
49
|
+
expect { subject }.to raise_error Derelict::Parser::BoxList::InvalidFormat
|
50
|
+
end
|
42
51
|
end
|
43
52
|
end
|
44
53
|
|