epilicious 0.1.0

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.
@@ -0,0 +1 @@
1
+ require 'test_helper'
@@ -0,0 +1,32 @@
1
+ require 'test_helper'
2
+
3
+ describe Epilicious::Fetcher do
4
+ let(:fetcher) { Epilicious::Fetcher.new }
5
+
6
+ context '#fetch_recipes' do
7
+ let(:recipes) { fetcher.fetch_recipes }
8
+
9
+ it 'should return a list of recipes' do
10
+ recipes.length.must_equal 15
11
+ recipes.last.must_be_instance_of Epilicious::Recipe
12
+ end
13
+ end
14
+
15
+ context '#fetch_recipe' do
16
+ let(:recipe) { fetcher.fetch_recipe }
17
+ it' should return a recipe' do
18
+ recipe.must_be_instance_of Epilicious::Recipe
19
+ end
20
+ end
21
+
22
+ context 'private methods' do
23
+ let(:url) { "/articlesguides/bestof/toprecipes/bestburgerrecipes" }
24
+ let(:recipes_page) { fetcher.send(:fetch_page, url) }
25
+
26
+ context '#fetch_page' do
27
+ it 'should return a nokogiri document' do
28
+ recipes_page.must_be_instance_of Nokogiri::HTML::Document
29
+ end
30
+ end
31
+ end
32
+ end