Re: [TFUI] Mock The Server

Cory Foy <[email protected]> Thu, 29 Sep 2005 08:15:26 -0400
Newsgroups gmane.comp.programming.test-first-user-interfaces
Message-ID <[email protected]>
Phlip wrote:
> The servePage() fixture then creates a mock Request and a real HTTPResponse 
> object. We pass the URI into the mock request, and call the target do_GET() 
> method. That is the Activate step of the sequence Assemble, Activate, 
> Assert.
> 
> Here's a test case to show we hit the front page correctly:
> 
>  def test_miniServerLikesTheFrontPage()
>   response = servePage('FrontPage')
>   assert_equal 200, response.status = 200
>   assert_equal "text/html", response['Content-Type']
>   assert_match /title.FrontPage..title/, response.body
>  end

I'm still trying to wrap my head around this, and think I'm almost 
there. So what you are saying is that using this server you can mock the 
HTTP request object, and get back a *real* Response from the server? 
Isn't this the same model used by HttpUnit, NUnitAsp and others?

Cory



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/TestFirstUserInterfaces/

<*> To unsubscribe from this group, send an email to:
    TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/