[rspec-users] rspec + CakePHP

s.ross cwdinfo at gmail.com
Tue Jan 30 23:39:25 EST 2007

I'll take a shot at answering this. rSpec doesn't passively observe  
the code under test, it actively interrogates it. So rSpec, which is  
written in Ruby will not be mappable into the PHP space. Consider  
this example:

assigns[:person].first_name.should == 'bob'

Here's a snippet of controller spec that is reaching into the  
controller and checking out the contents of @person. See why it won't  

Have a look at this:


Still want to work in PHP?


On Jan 30, 2007, at 7:27 PM, sness wrote:

> Hi,
> I am in a situation where I am going to have to rewrite a working Ruby
> on Rails application in CakePHP with PHP5.  I have a whole bunch of
> specs written with rspec, and I was wondering if it would be possible
> to somehow use these specs to test the Models and Controllers that I
> am rewriting in CakePHP.  I am going to be basically just exactly
> duplicating the Rails application, with identical class and method
> names in PHP.
> I know this is perverse, but is it possible?
> Thanks,
> sness.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list