Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Passing data between modules using Test::Class

by adrianh (Chancellor)
on Dec 12, 2006 at 18:19 UTC ( #589349=note: print w/ replies, xml ) Need Help??


in reply to Passing data between modules using Test::Class

I tried the obvious, i.e. define a foo() accessor in the base Service class, and then use set/get in Service_A/Service_B respectively, but this does not work.

The reason being that Service_A and Service_B tests would be run on different objects that don't share state.

I was wondering if any of you have come across this problem, and found a way out, preferably using Test::Class and if not, what is the best way to solve this.

Without more information on the relationship between the service objects it's hard to tell. Can you show what/why Service_B needs Service_A's test results?


Comment on Re: Passing data between modules using Test::Class
Re^2: Passing data between modules using Test::Class
by arc_of_descent (Hermit) on Dec 13, 2006 at 07:31 UTC

    Hey Adrian,

    As I mentioned in my updated post, I'm now passing data by use of a class variable common to both Service_A and Service_B

    Without more information on the relationship between the service objects it's hard to tell. Can you show what/why Service_B needs Service_A's test results?

    I don't think that should matter. This test suite is for the Google::Adwords module. When I run the sandbox tests for, say the CampaignService test module, I then require the campaign ids for use in the AdGroupService test module. These are only for the sandbox tests, and I can test the various service modules independently otherwise.


    --
    Rohan

      I don't think that should matter. This test suite is for the Google::Adwords module. When I run the sandbox tests for, say the CampaignService test module, I then require the campaign ids for use in the AdGroupService test module. These are only for the sandbox tests, and I can test the various service modules independently otherwise.

      Fair enough. If it were me I'd probably factor out the common code into a separate module that both test classes used, enabling me to run each class independently. But that's just me ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://589349]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-12-28 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls