Bugzilla – Attachment 14839 Details for
Bug 9486
t/Letters.t loads modules in wrong order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9486: t/Letters.t loads modules in wrong order
SIGNED-OFF-Bug-9486-tLetterst-loads-modules-in-wro.patch (text/plain), 1.43 KB, created by
Katrin Fischer
on 2013-01-24 19:39:09 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9486: t/Letters.t loads modules in wrong order
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-01-24 19:39:09 UTC
Size:
1.43 KB
patch
obsolete
>From a3a93a8515c05479610cdd74660931c4fb6f7cf8 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Thu, 24 Jan 2013 13:58:07 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 9486: t/Letters.t loads modules in wrong > order > >Because the unit test t/Letters.t loads C4::Letters before C4::Context, >and C4::Letters is not even vaguely thread-safe, the test tends to fail. >Usually. Moving the dbh mocking to before the use_ok('C4::Letters') test >fixes the problem. > >To test: >1) Before applying patch, run `prove t/Letters.t` a few times. Note that > it fails most of the time, if not all the time. >2) Apply patch. >3) Repeat step (1), noting that now it passes every time. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Works as advertised. >--- > t/Letters.t | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > >diff --git a/t/Letters.t b/t/Letters.t >index b269e86..2d5f557 100755 >--- a/t/Letters.t >+++ b/t/Letters.t >@@ -8,10 +8,6 @@ use warnings; > use Test::MockModule; > use Test::More tests => 2; > >-BEGIN { >- use_ok('C4::Letters'); >-} >- > my $module = new Test::MockModule('C4::Context'); > $module->mock( > '_new_dbh', >@@ -27,6 +23,8 @@ my $mock_letters = [ > [ 'bleh', 'ISSN', 'NSSI', 'page', 0, 'blue', 'blehbleh' ] > ]; > >+use_ok('C4::Letters'); >+ > my $dbh = C4::Context->dbh(); > > $dbh->{mock_add_resultset} = $mock_letters; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9486
:
14831
|
14835
| 14839