test/isbn_spec.rb in isbn-2.0.8 vs test/isbn_spec.rb in isbn-2.0.9
- old
+ new
@@ -57,14 +57,19 @@
ISBN.valid?("9790879392788").must_equal true
ISBN.valid?("2900820472675").must_equal true
ISBN.valid?("012781910X").must_equal true
ISBN.valid?("9887401392").must_equal false
ISBN.valid?("082047267").must_equal false
+ ISBN.valid?("3-540-49698-X").must_equal true
+ ISBN.valid?("3-540-49698-x").must_equal true
ISBN.valid?(nil).must_equal false
end
it "should get isbn from source string" do
ISBN.from_string("ISBN:978-83-7659-303-6\nmore of content").must_equal "978-83-7659-303-6"
+ ISBN.from_string("ISBN-13 978-3-540-49698-4 and more content").must_equal "978-3-540-49698-4"
+ ISBN.from_string("ISBN-10 3-921099-34-X and more content").must_equal "3-921099-34-X"
+ ISBN.from_string("ISBN-10 3-921099-34- x and more content").must_equal "3-921099-34-x"
end
it "should add dashes to isbn 13 without dashes" do
ISBN.with_dashes("9780763740382").must_equal "978-0-7637-4038-2"
end