t6d-mensa 0.1.1 → 0.1.2
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.
- data/VERSION +1 -1
- data/fixtures/output.txt +0 -24
- data/lib/mensa/client.rb +1 -4
- data/lib/mensa/exceptions.rb +0 -2
- data/lib/mensa/fare.rb +6 -5
- data/mensa.gemspec +1 -1
- data/spec/mensa/fare_spec.rb +7 -15
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/fixtures/output.txt
CHANGED
@@ -4,24 +4,14 @@
|
|
4
4
|
|
5
5
|
Gemüse- Maultaschen mit Tomatensauce 1,80 €
|
6
6
|
|
7
|
-
--
|
8
|
-
|
9
7
|
Linsen-Orangensuppe mit Baguette 2,10 €
|
10
8
|
|
11
|
-
--
|
12
|
-
|
13
9
|
Rühreier mit Rahmspinat 1,20 €
|
14
10
|
|
15
|
-
--
|
16
|
-
|
17
11
|
Wokpfanne "Hot-Asia-Style" mit Hähnchenbrust und Mie-Nudeln 2,80 €
|
18
12
|
|
19
|
-
--
|
20
|
-
|
21
13
|
Hähnchen-Nuggets-im Knuspermantel dazu ein Kräuterdip 1,90 €
|
22
14
|
|
23
|
-
--
|
24
|
-
|
25
15
|
Grillbraten vom Schweinenacken mit Thymianjus 2,00 €
|
26
16
|
|
27
17
|
|
@@ -38,34 +28,20 @@
|
|
38
28
|
|
39
29
|
Vier Kartoffelpuffer mit Apfelmus und eine Beilage nach Wahl 2,10 €
|
40
30
|
|
41
|
-
--
|
42
|
-
|
43
31
|
Balkanröllchen mit Knoblauchdip dazu Pommes frites und eine 2,50 €
|
44
32
|
Beilage nach Wahl
|
45
33
|
|
46
|
-
--
|
47
|
-
|
48
34
|
Hähnchenbrust Hawaii mit Ananas und Käse überbacken und 2,90 €
|
49
35
|
Pommes frites dazu eine Beilage nach Wahl
|
50
36
|
|
51
|
-
--
|
52
|
-
|
53
37
|
Schweineschnitzel mit Champignonrahmsauce dazu Pommes frites 3,50 €
|
54
38
|
und eine Beilage nach Wahl
|
55
39
|
|
56
|
-
--
|
57
|
-
|
58
40
|
Seelachsfilet paniert mit Sauce Tatar 1,50 €
|
59
41
|
|
60
|
-
--
|
61
|
-
|
62
42
|
Pasta Bolognese 1,60 €
|
63
43
|
|
64
|
-
--
|
65
|
-
|
66
44
|
Wokpfanne "Thai 7 Spice" mit Putenbrust und Basmatireis 2,80 €
|
67
45
|
|
68
|
-
--
|
69
|
-
|
70
46
|
Country Kartoffeln mit Quark 1,10 €
|
71
47
|
|
data/lib/mensa/client.rb
CHANGED
data/lib/mensa/exceptions.rb
CHANGED
data/lib/mensa/fare.rb
CHANGED
@@ -5,6 +5,7 @@ module Mensa
|
|
5
5
|
TYPES = {
|
6
6
|
'S' => :pork,
|
7
7
|
'R' => :beef,
|
8
|
+
'RS' => :mixed,
|
8
9
|
'K' => :veal,
|
9
10
|
'L' => :lamb,
|
10
11
|
'G' => :poultry,
|
@@ -35,14 +36,14 @@ module Mensa
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def type=(value)
|
38
|
-
if value.nil?
|
39
|
-
|
39
|
+
@type = if value.nil?
|
40
|
+
nil
|
40
41
|
elsif TYPES.values.include?(value)
|
41
|
-
|
42
|
+
value
|
42
43
|
elsif TYPES.keys.include?(value)
|
43
|
-
|
44
|
+
TYPES[value]
|
44
45
|
else
|
45
|
-
|
46
|
+
nil
|
46
47
|
end
|
47
48
|
|
48
49
|
@type
|
data/mensa.gemspec
CHANGED
data/spec/mensa/fare_spec.rb
CHANGED
@@ -27,10 +27,6 @@ module Mensa
|
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "#type" do
|
30
|
-
it 'should raise an TypeUnknownError with :invalid as argument' do
|
31
|
-
lambda { subject.type = :invalid }.should raise_error(TypeUnknownError)
|
32
|
-
end
|
33
|
-
|
34
30
|
types = {
|
35
31
|
'S' => :pork,
|
36
32
|
'R' => :beef,
|
@@ -39,19 +35,15 @@ module Mensa
|
|
39
35
|
'G' => :poultry,
|
40
36
|
'F' => :fish,
|
41
37
|
'FL' => :meatless,
|
42
|
-
nil => nil
|
38
|
+
nil => nil,
|
39
|
+
'' => nil,
|
40
|
+
' ' => nil
|
43
41
|
}
|
44
42
|
|
45
|
-
types.
|
46
|
-
it "should
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
|
51
|
-
types.keys.each do |type|
|
52
|
-
it "should recognise #{type.inspect} as valid type" do
|
53
|
-
lambda { subject.type = type }.should_not raise_error(TypeUnknownError)
|
54
|
-
subject.type.should == types[type]
|
43
|
+
types.each do |given, expected|
|
44
|
+
it "should return #{expected.inspect} if #{given.inspect} was given" do
|
45
|
+
subject.type = given
|
46
|
+
subject.type.should == expected
|
55
47
|
end
|
56
48
|
end
|
57
49
|
end
|