razsell 0.0.5 → 0.0.6
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/README.rdoc +1 -1
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/docs/feed sample.txt +15 -0
- data/docs/item sample.txt +36 -0
- data/lib/razsell/engine.rb +0 -10
- data/lib/razsell/item.rb +1 -1
- data/razsell.gemspec +8 -12
- metadata +6 -11
- data/features/product_lines.feature +0 -13
- data/features/step_definitions/product_line_steps.rb +0 -28
- data/lib/razsell/product_line.rb +0 -14
- data/lib/razsell/product_line_parser.rb +0 -19
- data/test/fixtures/productlines.htm +0 -960
- data/test/product_line_parser_test.rb +0 -33
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ProductLineParserTest < Test::Unit::TestCase
|
4
|
-
context "parsing the document" do
|
5
|
-
setup do
|
6
|
-
@parser = Razsell::ProductLineParser.new
|
7
|
-
end
|
8
|
-
|
9
|
-
should "return an empty array when passed nil" do
|
10
|
-
section = @parser.parse nil
|
11
|
-
assert_equal Array, section.class
|
12
|
-
assert_equal 0, section.length
|
13
|
-
end
|
14
|
-
|
15
|
-
should "get the relevent text from the document" do
|
16
|
-
section = @parser.get_elements feed("productlines")
|
17
|
-
assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196854021783912655">Cheeze</a>', section[0].to_html
|
18
|
-
assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196596454716712290">New Products</a>', section[1].to_html
|
19
|
-
assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196983228798280961">Smim</a>', section[2].to_html
|
20
|
-
end
|
21
|
-
|
22
|
-
should "populate the array with ProductLine objects" do
|
23
|
-
section = @parser.parse feed("productlines")
|
24
|
-
assert_equal '196854021783912655', section[0].id
|
25
|
-
assert_equal '196596454716712290', section[1].id
|
26
|
-
assert_equal '196983228798280961', section[2].id
|
27
|
-
|
28
|
-
assert_equal 'Cheeze', section[0].name
|
29
|
-
assert_equal 'New Products', section[1].name
|
30
|
-
assert_equal 'Smim', section[2].name
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|