From 01e498f539f36b734ea2fadbe34bd2d8626af148 Mon Sep 17 00:00:00 2001 From: Chris Jaekl Date: Fri, 21 Jun 2024 19:19:18 -0400 Subject: [PATCH] Augment unit test for Book class --- test/book_test.rb | 51 ++++++++++++++++++ test/conn_mock.rb | 24 +++++++++ .../LouisaAlcott/LW01_Little_Women.epub | Bin 0 -> 23045 bytes test/store_mock.rb | 29 ++++++++++ test/test_helper.rb | 4 ++ 5 files changed, 108 insertions(+) create mode 100644 test/conn_mock.rb create mode 100644 test/sample_data/LouisaAlcott/LW01_Little_Women.epub create mode 100644 test/store_mock.rb diff --git a/test/book_test.rb b/test/book_test.rb index 90c918a..bb476c7 100644 --- a/test/book_test.rb +++ b/test/book_test.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true require "test_helper" + require "book" +require "store_mock" class BookTest < Minitest::Test def test_that_it_can_handle_epub_and_pdf_files @@ -28,4 +30,53 @@ class BookTest < Minitest::Test assert_equal expected, Book.grouping_for_title(input) end end + + def test_load_from_file + store = StoreMock.new + store.expects(:get_series).returns(mock_series_LW) + store.connect + book = Book.new(store) + + book.load_from_file!(File.join(TestHelper::SAMPLE_DATA_PATH, "LouisaAlcott", "LW01_Little_Women.epub")) + + author = book.author + + assert_equal "LouisaAlcott", author.grouping + assert_equal "Louisa May Alcott", author.reading_order + assert_equal "Alcott, Louisa May", author.sort_order + + assert_equal "This story follows the lives of the four March sisters&emdash;Meg, Jo, Beth, and Amy&emdash;and details their coming of age.", book.description + assert_equal "en", book.language + assert_equal "Little Women: Or, Meg, Jo, Beth and Amy", book.title + assert_equal mock_series_LW.to_s, book.series_id.to_s + assert_equal 1, book.volume.to_i + end + + def test_heading + store = StoreMock.new + store.expects(:get_series).returns(mock_series_LW) + store.connect + book = Book.new(store) + + book.load_from_file!(File.join(TestHelper::SAMPLE_DATA_PATH, "LouisaAlcott", "LW01_Little_Women.epub")) + + expected = "Little Women: Or, Meg, Jo, Beth and Amy
by Louisa May Alcott
01" + actual = book.heading + + assert_equal expected, actual + end + + private + + def mock_series_LW + id = 1 + series = Series.new(id) + series.age = "ya" + series.genre = "romance" + series.grouping = "LoisaAlcott" + series.code = "LW" + series.descr = "Little Women" + + series + end end diff --git a/test/conn_mock.rb b/test/conn_mock.rb new file mode 100644 index 0000000..c090404 --- /dev/null +++ b/test/conn_mock.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class ConnMock + def initialize + @mock_connected = true + @stmts = [] + end + + def close + raise ".close() called on already closed connection" unless @mock_connected + + @mock_connected = false + end + + def exec(*args, &block) + @stmts << args + return nil + end + + def exec_params(*args, &block) + @stmts << args + return nil + end +end diff --git a/test/sample_data/LouisaAlcott/LW01_Little_Women.epub b/test/sample_data/LouisaAlcott/LW01_Little_Women.epub new file mode 100644 index 0000000000000000000000000000000000000000..cfccd0c0c3be61d0431cdb1c06d4431c4feca888 GIT binary patch literal 23045 zcma&MQ;;q^&^0=?ZDWsZ+cuxEZQI^s+qP|Ek8RtY`QPui^OFPZ$W~f4ct~^nZ{OQx&3N9nvR1BE=|3wv{sYo~a4f>0CQU`GL6je>X_&OUsQ+{)-3rukE~$yA&RYsoVGvU&|*79)1k%*@@QxavCQx8 zJ{6PBsb?SDr@=c|BVaGJ=)kt_x3|v8;TE0>*DXn!rWJ-wmlKMvmH^!i|6xkqAoXZn zZX6X2^}&Ghh{Zsv{qK>AtL(az?}47N@(>``!*zI9>sI(Y5kS^H|~ z)_$h@ufR(3QYK+u4p`d44O8fe+$*~1g!R=!o|O3t>6{Q^Eb*Pf5yI~%mtMX9$hj$O zu_H;*T3JmO{=02tik}V{?nCY=j=0pPe;dv>@c*XGkggjP^?&!p{T~qjH*Nm^u;xFS z)Dvk|r^5bUbU5^78l{v40uuiZ|Ff*Iy_=~Mz|!_VQqo&Fm?yiND&pGA+d87WDh}*`LgA^|`;U&fai6PB*c5 zyXA4@z5*9-7(ihKgoQyke9ZyRDFj$BE^Vfek28?XudAhwkaDg8)FsE)=f=k7I3yY2 zF2J81T?2cOo?u-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jsAf69?=knTiD}+I7k<<*SDpABdDF8secCM{XqV@WY*04FJ(uDZ z>7d;DQ5X9c=asmXzB@;WwkwMN3^p6G`wu}6O&Q8V!2Q-Edf9t9S^qY6a{B(GJ=5-T z*`gzA+hw0n(o^RV&Zy`UD2Lu)!rJs_@|Nldd?6NM!5tx_!xb~KuAQwHUq>y6cK2p# zkaOqf2AuO^IAnDejj|P7#?RXQS0tYbS*s$G7xbyx#axG;y3>66A^8cud9~@bq4Px= z4UmiDB#qjSZ)qJ@kr?GBPS0vHgUzH{G3`naHxzl)$>xZKuT1Bou%Rz*k2t<0p=ZkH zVt;RE74>V(FZr1F)F+rr0zT`;08Egmsn8o^9OR!_d4EuMWkn!{oySRgO`Z~>HSt-S z{rl^Bg7x`ma6889r<4A(8~b>}6v#otr2(IQM(E|91jX18o>tp$7!jHcUBEm-FW+C? z$DPYy0g1R}V_E%v-E&z2GTTDLhhHZ&mkQ=Ye8!c1?_$)vijlD8DyB@NRxN&JaTP|? z=@$iD4e1C-0^Dg8SD{(r2mQ#q-Peh>+pA5wEm750g~y7F)d_x#New(3b+#n05#DE$ z1fI0O36iwR4tk7egnm5|WNL7&4c0!~BB6&~hu~rRPo=7zwYAr8KW0X)-++|K>eYnD<1S({gs|b zjE3M^P%ig=2{0=7A$Q0qWT^kYX!jwD|5!pEs^=f=?jP#^mhAqMK|(r2{w)&yALZ_2 z?6Gq9zp)Tx%YVoIL%{nujmM(f|4yU$HP6E(Ki1wprXPE1|IpPB^uMgNkDL0k{0e&P#eGESy^ZbEHHUE7C^q70xoB!e5A0)xQ%lBV>`(yBN p%k&3a)BRuV)MNN@to(svUObK*O;vP^-^Xzu*64@Wveo~+_h0+l>T&=8 literal 0 HcmV?d00001 diff --git a/test/store_mock.rb b/test/store_mock.rb new file mode 100644 index 0000000..897e79a --- /dev/null +++ b/test/store_mock.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require "conn_mock" +require "store" + +class StoreMock < Store + def initialize + @dbhost = "host" + @dbport = 5432 + @dbname = "dbname" + @dbuser = "dbuser" + @dbpass = "dbpass" + @basePath = "base_path" + + @conn = nil + end + + def connect + raise "Mock error: .connect called when already connected" if @conn + + @conn = ConnMock.new + end + + def disconnect + raise "Mock error: .disconnect called when not connected" unless @conn + + @conn = nil + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index 25bf530..f212ec1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,3 +4,7 @@ $LOAD_PATH.unshift File.expand_path("../app", __dir__) require "minitest/autorun" require "mocha/minitest" + +module TestHelper + SAMPLE_DATA_PATH = File.expand_path("./sample_data", __dir__) +end -- 2.39.2