Forum: RSpec Rails3 + RSpec2 sample project?

Posted by Jacques Crocker (Guest)
on 2010-02-07 13:30
(Received via mailing list)
If anyone has any sort of Rails3 + Rspec2 project sort of working, we
should get a stripped down sample project on github. Martin did a
great one for datamapper: http://github.com/snusnu/datamapper_on_rails3.
I can help getting it organized / tested, but I havent been able to
get things working quite yet.

I know its all sort of still in flux at the moment. But any help would
be appreciated on how to organize rspec with rails3.
Posted by David Chelimsky (Guest)
on 2010-02-07 21:49
(Received via mailing list)
On Sun, Feb 7, 2010 at 3:48 AM, Jacques Crocker <merbjedi@gmail.com> 
wrote:
> If anyone has any sort of Rails3 + Rspec2 project sort of working, we
> should get a stripped down sample project on github. Martin did a
> great one for datamapper: http://github.com/snusnu/datamapper_on_rails3.
> I can help getting it organized / tested, but I havent been able to
> get things working quite yet.
>
> I know its all sort of still in flux at the moment. But any help would
> be appreciated on how to organize rspec with rails3.

I don't have time to do a proper blog post right now, but I'll try to
get something up in a day or two. In the mean time, assuming you have
rails 3 pre already installed:

rails foo
cd foo
echo "gem 'rspec-rails', '>=2.0.0.a5' :group => :test" >> Gemfile
script/rails generate rspec:install

rspec:install installs, among other things, a generator so you can just 
say:

  script/rails generate model thing name:string

... and you'll get a model spec instead of a rails unit test.

The a5 release only supports model and request (integration - a la
merb) specs, but controllers, views and helpers will be coming soon.

Cheers,
David
Posted by David Chelimsky (Guest)
on 2010-02-07 21:53
(Received via mailing list)
On Sun, Feb 7, 2010 at 2:41 PM, David Chelimsky <dchelimsky@gmail.com> 
wrote:
> I don't have time to do a proper blog post right now, but I'll try to
> get something up in a day or two. In the mean time, assuming you have
> rails 3 pre already installed:
>
> rails foo
> cd foo
> echo "gem 'rspec-rails', '>=2.0.0.a5' :group => :test" >> Gemfile

This should be:

  echo "gem 'rspec-rails', '>=2.0.0.a5', :group => :test" >> Gemfile

(was missing a comma).
Posted by Ashley Moran (Guest)
on 2010-02-07 22:59
(Received via mailing list)
On 7 Feb 2010, at 8:41 PM, David Chelimsky wrote:

> The a5 release only supports model and request (integration - a la
> merb) specs, but controllers, views and helpers will be coming soon.

Well chop chop then, anyone would think you were working for free ;o)

On a more serious note, I think the Rails 3 beta is the final trigger 
for me to switch from the (I'm sad to say) increasingly rusty Merb to 
Rails 3 / Ruby 1.9.  It's clear there are a plenty of integration issues 
to work out.  I'm currently spending at least half my time working on a 
project of my own, but I can't see that moving forwards until I have 
RSpec/Cucumber in place.  So feel free to point me to relevant RSpec 
tickets and I'll work on those instead, in the mean time.

Ashley

--
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
Posted by anywho (Guest)
on 2010-02-23 01:17
(Received via mailing list)
I'm using this setup with rails 3/1.9.1 and this aforementioned gem.
However, when running rake spec, I get this error:

no such file to load -- test/unit/assertionfailederror

seems 1.9.1 no longer has this file. I tested running it with
commenting out this requirement and simply adding the below to the
rake file, and everything runs fine then.

Suggestions welcome on how to best approach this. Short of branching
rspec, I'm not sure what to do here. The file with the offending code
is: rspec/rails/matchers.rb


module Test
  module Unit
    # Thrown by Test::Unit::Assertions when an assertion fails.
    class AssertionFailedError < StandardError
    end
  end
end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.