rbook-bisac 0.6 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/rbook/bisac/po_line_item.rb +1 -0
- data/specs/new_po_line_item_spec.rb +15 -1
- metadata +1 -1
data/Rakefile
CHANGED
@@ -7,11 +7,12 @@ context "A new bisac purchase order line item object" do
|
|
7
7
|
|
8
8
|
setup do
|
9
9
|
@valid_row = "4000003 14976 Y000000000102978513220000100000000000000000000550000000"
|
10
|
+
@valid_row_two = "4000033 13424 Y000000001107538214940000200000000000000000000400000000 \n"
|
10
11
|
@valid_isbn13_row = "4000003 14627 Y000000000103855198500000600000000000000000000400000000 9780385519854"
|
11
12
|
@invalid_row_nil = nil
|
12
13
|
@invalid_row_num = 23
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
specify "Should load a line from a bisac po file correctly" do
|
16
17
|
item = RBook::Bisac::POLineItem.load_from_string(@valid_row)
|
17
18
|
item.should be_a_kind_of(RBook::Bisac::POLineItem)
|
@@ -25,6 +26,19 @@ context "A new bisac purchase order line item object" do
|
|
25
26
|
item.price.should eql(0)
|
26
27
|
end
|
27
28
|
|
29
|
+
specify "Should load a line from a bisac po file correctly, even if they they have whitepsace padding" do
|
30
|
+
item = RBook::Bisac::POLineItem.load_from_string(@valid_row_two)
|
31
|
+
item.should be_a_kind_of(RBook::Bisac::POLineItem)
|
32
|
+
|
33
|
+
item.sequence_number.should eql(33)
|
34
|
+
item.po_number.should eql("13424")
|
35
|
+
item.line_item_number.should eql("0000000011")
|
36
|
+
item.isbn.should eql("0753821494")
|
37
|
+
item.qty.should eql(2)
|
38
|
+
item.catalogue_code.should eql("0")
|
39
|
+
item.price.should eql(0)
|
40
|
+
end
|
41
|
+
|
28
42
|
specify "Should prefer the ISBN13 over ISBN10 when available" do
|
29
43
|
item = RBook::Bisac::POLineItem.load_from_string(@valid_isbn13_row)
|
30
44
|
item.should be_a_kind_of(RBook::Bisac::POLineItem)
|