From ae2c8a8dd73c50d21c2f112a683d176ed060af6d Mon Sep 17 00:00:00 2001 From: reborg Date: Sun, 27 Dec 2009 17:40:27 +0100 Subject: [PATCH] now using a test database --- spec/models/pomodoro_persistence_spec.rb | 8 ++++---- spec/spec_helper.rb | 2 -- spec/test_mom/Pomodori.mom | Bin 0 -> 1308 bytes 3 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 spec/test_mom/Pomodori.mom diff --git a/spec/models/pomodoro_persistence_spec.rb b/spec/models/pomodoro_persistence_spec.rb index 96147ff..14dd6b7 100644 --- a/spec/models/pomodoro_persistence_spec.rb +++ b/spec/models/pomodoro_persistence_spec.rb @@ -4,12 +4,12 @@ class PomodoroPersistenceSpec < Test::Unit::TestCase it 'retrieve the count of saved pomodoros' do - Persistence.stubs(:object_model_from_bundle).returns(mom) - Pomodoro.count.should == 15 + Persistence.stubs(:object_model_from_bundle).returns(test_mom) + Pomodoro.count.should == 59 end end -def mom - bundle = NSBundle.bundleWithPath(APP_ROOT + "/build/Debug/#{APP_NAME}.app/") +def test_mom + bundle = NSBundle.bundleWithPath(File.dirname(__FILE__) + "/../test_mom") NSManagedObjectModel.mergedModelFromBundles([bundle]) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 58d9f7f..d427702 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,5 +4,3 @@ require 'matchy' require 'test/unit' -APP_ROOT = File.expand_path(File.dirname(__FILE__) + "/..") -APP_NAME = "PomodoriXCode" diff --git a/spec/test_mom/Pomodori.mom b/spec/test_mom/Pomodori.mom new file mode 100644 index 0000000000000000000000000000000000000000..9cf41c3303a4aca10a1d845839cb1ebbf4341b09 GIT binary patch literal 1308 zcmZ`&ZD<@t7@nCoP49Y5v-xi0w>gVH+L*?sIW?(`O_QD_o9pe}>zUIGCx^6*D7Idv#d!*th|-AZ0piZH{Wt=;I`ZExU(a8*H-0jrB&J1dPvnGwpHY| zO9$)Y4!6UFoaHea(F^(%&yISMN31M2z4Ts}oT}&fkY#&H$|(DO!N>Y5XBy{wm164`(QaIBNyY3|w~YiDOK+`F@9 z*F@DUEak~+==$2EY9l3~r%gU+WCV6jx6AWAy&+_DEs<2Usx}Yvf!(sU($_D2(qDOS zkK7>ZVuH_zabe`qdp%#gG`MeQIIutbaL0koBZ?9^813teBgTpc^{O@?gl(itg2&25 zK8a`XoL(|TLN`l1rL>|+ZWOcif|IlCJhxqAQp%P!mEMk3i;-{G87+DWOaxqRR@tqK zrXsSYft^KPh}P8)}%;&rOmtn`MEQUUK4cBg9E8t6(9 z>0EE&LZHcZWRu(N(y=&-6R>eR^xm zwk#nj@sS47PCCeT(oK5FD2bCvVxYs%kvTF?-Xsg;9r8X|BA=5l$T@PJd_}$?-;>|T z6$-SS?x10spjm3u=jn0!0)2_TOi$30^i}#gJw@N3r|DaCfxb=Oqf7KN`UCxm{z@;? zEA%S;hyKebt6{aw$Ld%c+s1m>FiS9t9cQnx1$KtL%NE%O>_heu`