hangry 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require 'hangry'
2
2
 
3
3
  describe Hangry do
4
4
 
5
- context "food network recipe" do
5
+ context "standard food network recipe" do
6
6
  subject { Hangry.parse(File.read("spec/fixtures/food_network_schema_org.html")) }
7
7
 
8
8
  its(:canonical_url) { should == 'http://www.foodnetwork.com/recipes/rachael-ray/spinach-and-mushroom-stuffed-chicken-breasts-recipe/index.html' }
@@ -52,6 +52,56 @@ Place a mound of stuffing on each breast and wrap and roll breast over the stuff
52
52
 
53
53
  end
54
54
 
55
+ context "food network recipe with some blank ingredients" do
56
+ subject { Hangry.parse(File.read("spec/fixtures/food_network_with_blank_ingredients.html")) }
57
+
58
+ its(:canonical_url) { should == 'http://www.foodnetwork.com/recipes/food-network-kitchens/easter-bunny-cake-recipe/index.html' }
59
+ its(:cook_time) { should == nil }
60
+ its(:description) { should == nil }
61
+ its(:ingredients) do
62
+ should == [
63
+ "3 sticks (12 ounces) unsalted butter, at room temperature",
64
+ "6 cups confectioners' sugar",
65
+ "Pinch fine salt",
66
+ "1 tablespoon vanilla extract",
67
+ "2 to 3 tablespoons milk",
68
+ "2 baked 9-inch round cake layers (your favorite recipe or a 18.25-ounce boxed cake mix)",
69
+ "1 1/4 cup sweetened flaked coconut",
70
+ "2 store-bought biscotti",
71
+ "1 tube pink decorating icing",
72
+ "2 black jelly beans",
73
+ "2 marshmallows",
74
+ "1 white jelly bean, halved lengthwise",
75
+ "1 pink jelly bean",
76
+ "1 black licorice wheel, such as Haribo"
77
+ ]
78
+ end
79
+ it "should filter out blank ingredients" do
80
+ subject.ingredients.should_not include ""
81
+ end
82
+
83
+ its(:instructions) do
84
+ instructions = <<-instructions
85
+ For the frosting: Combine the butter, sugar and salt in the bowl of a stand mixer fitted with a paddle attachment (or in a large bowl if using a hand-held electric mixer). Mix on low speed until mostly incorporated. Add the vanilla, increase the speed to medium-high and mix until smooth. Adjust the consistency with milk until the frosting is easy to spread.
86
+ For the bunny: Spread a thin layer of frosting on the flat side of one cake layer, about 2/3 cup, and top with the flat side of the second cake layer. Measure 5 inches across the top of the cake and cut down through the layers, creating two layered pieces that are slightly different sizes.
87
+ Place the larger piece of cake, cut-side down, on a large platter or cake board. If using a rectangular cake board, place the larger piece so that the long edges are parallel with the long edges of the board. This is the body of the bunny. Cut the smaller piece of cake in half crosswise, so you have two layered wedges. Place one wedge in front of the body, with one flat side on the board and the other flat side against the body. The curved side will be on top. Take a serrated knife and round off the sharp edges on top of the head. Cut the tip off (the nose) at a 45-degree angle. Reserve all scraps in a bowl.
88
+ Separate the layers of the remaining wedge of cake. These will be the back legs. Round the sharp edges of the cake wedges with your knife, and add to the scrap bowl. Place one piece on each side of the bunny, with one flat side down and the other flat side facing forward (the round side towards the back of the bunny), about 1-inch from the end of the bunny's body.
89
+ Mix the cake scraps in the bowl with a fork until mashed, and then pack into a ball with your hands. Place the ball behind the bunny's body and adhere with a dab of frosting. This is the bunny's tail.
90
+ instructions
91
+ should == instructions.strip
92
+ end
93
+
94
+ its(:name) { should == "Easter Bunny Cake" }
95
+ its(:prep_time) { should == 60 }
96
+ its(:published_date) { should == Date.parse("2013-04-01") }
97
+ its(:total_time) { should == 60 }
98
+ its(:yield) { should == "12 to 14 servings" }
99
+
100
+ it 'should parse the name of a schema.org Person when they are the author' do
101
+ subject.author.should == 'Food Network Kitchens'
102
+ end
103
+
104
+ end
55
105
  end
56
106
 
57
107
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hangry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-25 00:00:00.000000000Z
12
+ date: 2013-04-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70314683800080 !ruby/object:Gem::Requirement
16
+ requirement: &70196235674160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70314683800080
24
+ version_requirements: *70196235674160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70314683799600 !ruby/object:Gem::Requirement
27
+ requirement: &70196235673680 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70314683799600
35
+ version_requirements: *70196235673680
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pry
38
- requirement: &70314683799140 !ruby/object:Gem::Requirement
38
+ requirement: &70196235673220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70314683799140
46
+ version_requirements: *70196235673220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &70314683798640 !ruby/object:Gem::Requirement
49
+ requirement: &70196235672600 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3.0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70314683798640
57
+ version_requirements: *70196235672600
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: iso8601
60
- requirement: &70314683798120 !ruby/object:Gem::Requirement
60
+ requirement: &70196235672000 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.4.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70314683798120
68
+ version_requirements: *70196235672000
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
- requirement: &70314683797640 !ruby/object:Gem::Requirement
71
+ requirement: &70196235671420 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '1.5'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70314683797640
79
+ version_requirements: *70196235671420
80
80
  description: A recipe microformat parser.
81
81
  email:
82
82
  - ian@iancanderson.com
@@ -85,6 +85,7 @@ extensions: []
85
85
  extra_rdoc_files: []
86
86
  files:
87
87
  - .gitignore
88
+ - .rspec
88
89
  - .travis.yml
89
90
  - Gemfile
90
91
  - LICENSE
@@ -105,6 +106,7 @@ files:
105
106
  - spec/fixtures/bigoven.html
106
107
  - spec/fixtures/epicurious.html
107
108
  - spec/fixtures/food_network_schema_org.html
109
+ - spec/fixtures/food_network_with_blank_ingredients.html
108
110
  - spec/fixtures/myrecipes.com.html
109
111
  - spec/hangry_spec.rb
110
112
  - spec/real_examples/all_recipes_spec.rb
@@ -141,6 +143,7 @@ test_files:
141
143
  - spec/fixtures/bigoven.html
142
144
  - spec/fixtures/epicurious.html
143
145
  - spec/fixtures/food_network_schema_org.html
146
+ - spec/fixtures/food_network_with_blank_ingredients.html
144
147
  - spec/fixtures/myrecipes.com.html
145
148
  - spec/hangry_spec.rb
146
149
  - spec/real_examples/all_recipes_spec.rb