Integration testing, advice

90 views
Skip to first unread message

Iain Barnett

unread,
Jan 31, 2012, 10:44:52 AM1/31/12
to sina...@googlegroups.com
Hi all,

I'm currently staring at a "uninitialized constant Rails" message after running some Webrat tests. Capybara hasn't been much more helpful (hence trying Webrat), so I was wondering, what frameworks are others using to test Sinatra - just Rack Test with RSpec/TestUnit...?  I'm trying to get some integration testing going, so what are other doing about testing any javascript on there?

Everything seems so Rails centric, but perhaps I'm looking in the wrong places or taking the wrong approach?

Any help or insight would be much appreciated.

Regards,
Iain

Don Hill

unread,
Jan 31, 2012, 12:28:35 PM1/31/12
to sina...@googlegroups.com
Here is my test group that I am using. I think I had this issue
before. Send the stack so we can take a look. I am also using rvm and
bundler to isolate things from my system rubygems.

gem 'rspec-core'
21 gem 'rspec-mocks'
22 gem 'rack-test'
23 gem 'rspec'
24 gem 'autotest'
25 gem 'autotest-growl'
26 gem 'autotest-fsevent'
27 gem 'capybara'
28 gem 'rspec-expectations'
29 gem 'webrat'
30 gem 'steak'
31 gem 'hpricot'
32 gem 'mechanize'
33 gem 'factory_girl'

> --
> You received this message because you are subscribed to the Google Groups
> "sinatrarb" group.
> To post to this group, send email to sina...@googlegroups.com.
> To unsubscribe from this group, send email to
> sinatrarb+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sinatrarb?hl=en.

Andrew Premdas

unread,
Feb 1, 2012, 5:10:13 AM2/1/12
to sina...@googlegroups.com
You can easily use Cucumber with Sinatra if you want too. Though I suspect many (most?) sinatra users would consider it overkill for a Sinatra app.

--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.



--
------------------------
Andrew Premdas

oren

unread,
Feb 11, 2012, 2:32:59 PM2/11/12
to sina...@googlegroups.com
I agree with apremdas regarding cucumber. I don't like it even for rails apps.
I prefer Capybara and Minitest for my acceptance testing.
it's faster to write and easier to maintain.

Take a look at my template for new sinatra apps: https://github.com/oren/sinatra-template

Andrew Premdas

unread,
Feb 11, 2012, 7:16:04 PM2/11/12
to sina...@googlegroups.com
On 11 February 2012 19:32, oren <oren...@gmail.com> wrote:
I agree with apremdas regarding cucumber. I don't like it even for rails apps.

I said most sinatra users, that doesn't include me :). I think cucumber is a great tool for specifying any application and personally would use it for any rails or sinatra app I was writing!

All best

Andrew

I prefer Capybara and Minitest for my acceptance testing.
it's faster to write and easier to maintain.

Take a look at my template for new sinatra apps: https://github.com/oren/sinatra-template

--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sinatrarb/-/wuKi1bS4FfsJ.

To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.

Iain Barnett

unread,
Feb 24, 2012, 8:34:06 AM2/24/12
to sina...@googlegroups.com
Thanks to all for the replies. I apologise for the delay, I didn't want to fire and forget a message, but a deadline hit and I really haven't had a chance to get back to this.


On 31 Jan 2012, at 17:28, Don Hill wrote:

> Here is my test group that I am using. I think I had this issue
> before. Send the stack so we can take a look. I am also using rvm and
> bundler to isolate things from my system rubygems.
>

I'll send the stack when I get back to this, I really appreciate the offer of help. I also use rvm and bundler, but I'd like to try rbenv too.


On 1 Feb 2012, at 10:10, Andrew Premdas wrote:

> You can easily use Cucumber with Sinatra if you want too. Though I suspect many (most?) sinatra users would consider it overkill for a Sinatra app.

I haven't gotten along well with Cucumber when I've tried it. I didn't like the way it writes the specs, I prefer the shorter `subject{ ... }` `it{ ... }` style of writing specs now.

I also felt I had to be too prescriptive in writing the features. Having said all that, I think the general idea of having features is really good, and the 3 point style is something I read in two places previously, one of them in http://www.alistapart.com/articles/taking-the-guesswork-out-of-design/, and the other in a book called Brilliant Project Management.

Maybe I need to try something like steak and see if it's for me. But not until I can get Capybara to work without problems!

Regards
Iain

Reply all
Reply to author
Forward
0 new messages