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 CHANGED
@@ -1 +1 @@
1
- 0.1.0
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
@@ -100,10 +100,7 @@ module Mensa
100
100
  end
101
101
 
102
102
  def print_seperator
103
- result = "\n"
104
- result += "--".center(80)
105
- result += "\n"
106
- result += "\n"
103
+ "\n"
107
104
  end
108
105
 
109
106
  def print_state_closed
@@ -5,8 +5,6 @@ module Mensa
5
5
 
6
6
  class NameTooLongError < FareError; end
7
7
 
8
- class TypeUnknownError < FareError; end
9
-
10
8
  class PriceStringInvalid < FareError; end
11
9
 
12
10
  class NameEmptyError < FareError; end
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
- @type = nil
39
+ @type = if value.nil?
40
+ nil
40
41
  elsif TYPES.values.include?(value)
41
- @type = value
42
+ value
42
43
  elsif TYPES.keys.include?(value)
43
- @type = TYPES[value]
44
+ TYPES[value]
44
45
  else
45
- raise TypeUnknownError, "Type #{value} is invalid", caller
46
+ nil
46
47
  end
47
48
 
48
49
  @type
data/mensa.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mensa}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Konstantin Tennhard"]
@@ -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.values.each do |type|
46
- it "should recognise #{type.inspect} as valid type" do
47
- lambda { subject.type = type }.should_not raise_error(TypeUnknownError)
48
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: t6d-mensa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Tennhard