<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 09/02/2010 11:52, Steven Mohapi-Banks wrote:
<blockquote
cite="mid:135944235517293134078044500423355441986-Webmail@me.com"
type="cite">
<pre wrap="">Hi,
A couple of devs in my team have some good mileage using Cucumber with Selenium, even to the point it runs on our headless CI server in this manner.</pre>
</blockquote>
I don't think of Selenium (not webdriver) as running in a truely
headless mode.
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
You can achieve a kind of headlessness via a virtual display in memory
but its still starting up a browser and doing rendering.<br>
<br>
It would be interesting to compare the performance of a true headless
tool vs a virtual display in memory.<br>
<br>
Selenium 2 (webdriver) supports a number of browser drivers and I've
heard (but not seen) that opera has a driver with a headless mode.<br>
<br>
Using Capybara can help provide isolation from the backend you are
using. Then you can easily switch modes to things like Celerity.<br>
<br>
--
<br>
Joseph Wilk
<br>
<a class="moz-txt-link-freetext" href="http://blog.josephwilk.net">http://blog.josephwilk.net</a>
<br>
+44 (0)7812 816431
<br>
<br>
<br>
<blockquote
cite="mid:135944235517293134078044500423355441986-Webmail@me.com"
type="cite">
<pre wrap=""> A potential solution would be to use this to spec out your front end, and use controller specs to spec the server API in isolation.
Selenium wasn't trivial to set up however. But the slight pain has been worth it.
</pre>
</blockquote>
Its also slow. I've seen 60/70 scenarios running under Selenium taking
10+ mins to execute.
<blockquote
cite="mid:135944235517293134078044500423355441986-Webmail@me.com"
type="cite">
<pre wrap="">Steve
On Tuesday, February 09, 2010, at 11:10AM, "Steve Graham" <a class="moz-txt-link-rfc2396E" href="mailto:sjtgraham@mac.com"><sjtgraham@mac.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">My usual approach is to test the model layer with RSpec, and write Cucumber stories for integration testing. Cucumber does a good job of touching most of the controller layer, and of course one can write specs for the rest.
I want to get the opinion of anyone who cares to chip in on this: At work we're developing a Sproutcore app with a Rails backend. As the Sproutcore app expects JSON in a certain structure, how and with what would you test this? I'm thinking writing controller specs, but does the Cucumber story paradigm make more (or any) sense for this use case. Personally I don't think it does, but I'm interested to hear your arguments for and against.
Finally has anyone on here developed a Sproutcore app? If so, what did you use for integration testing? I'd like to use Cucumber for this but with what? Webrat? Capybara? Watir?
S
On 9 Feb 2010, at 09:43, <a class="moz-txt-link-abbreviated" href="mailto:chat-request@lists.lrug.org">chat-request@lists.lrug.org</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Send Chat mailing list submissions to
<a class="moz-txt-link-abbreviated" href="mailto:chat@lists.lrug.org">chat@lists.lrug.org</a>
To subscribe or unsubscribe via the World Wide Web, visit
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
or, via email, send a message with subject or body 'help' to
<a class="moz-txt-link-abbreviated" href="mailto:chat-request@lists.lrug.org">chat-request@lists.lrug.org</a>
You can reach the person managing the list at
<a class="moz-txt-link-abbreviated" href="mailto:chat-owner@lists.lrug.org">chat-owner@lists.lrug.org</a>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Chat digest..."
Today's Topics:
1. Re: Cucumber and RSpec on Rails (Jordi Noguera Leon)
2. Re: Cucumber and RSpec on Rails (Joseph Wilk)
----------------------------------------------------------------------
Message: 1
Date: Tue, 9 Feb 2010 00:39:05 +0000
From: Jordi Noguera Leon <a class="moz-txt-link-rfc2396E" href="mailto:jordinoguera83@gmail.com"><jordinoguera83@gmail.com></a>
To: London Ruby Users Group <a class="moz-txt-link-rfc2396E" href="mailto:chat@lists.lrug.org"><chat@lists.lrug.org></a>
Subject: Re: [LRUG] Cucumber and RSpec on Rails
Message-ID:
<a class="moz-txt-link-rfc2396E" href="mailto:f8eaf1df1002081639g61934975k793e02c9e249278b@mail.gmail.com"><f8eaf1df1002081639g61934975k793e02c9e249278b@mail.gmail.com></a>
Content-Type: text/plain; charset="utf-8"
Thanks for your answers guys.
@Murray, that was a nice vid. Apparently, a rule of thumb would be to code
in the specs the stuff you wouldn't (or couldn't) talk with the business
guys and in the features the stuff you would discuss with them...
2010/2/8 Murray Steele <a class="moz-txt-link-rfc2396E" href="mailto:murray.steele@gmail.com"><murray.steele@gmail.com></a>
</pre>
<blockquote type="cite">
<pre wrap="">Joseph Wilk's talk at Scotland On Rails last year is a *really* good intro
into how features and tests (both controller and model) sit together
properly. I'd highly recommend watch it to get a grip on how you should
approach things, although if you aren't into watching videos, Neil has
pretty much nailed it (although he doesn't mention model tests).
Watch it here:
<a class="moz-txt-link-freetext" href="http://scotland-on-rails.s3.amazonaws.com/1A06_JosephWilk-SOR.mp4">http://scotland-on-rails.s3.amazonaws.com/1A06_JosephWilk-SOR.mp4</a>
One thing to note is that in most Railscasts Ryan Bates isn't showing you
the golden path of the true developer, just how to use the gem or library
he's covering in that episode. Accordingly he hardly ever writes tests,
unless it's a testing library or gem he's showing off. So it's not
surprising that in the cucumber episodes he doesn't do unit tests, as, in
theory, you already know how to write those, what you want to learn is how
to write cucumber features.
Muz
On 8 February 2010 22:12, Neil Edwards <a class="moz-txt-link-rfc2396E" href="mailto:neil@plasticwater.com"><neil@plasticwater.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Agreed, although it's sometimes still nice to hit the controller steps.
If you get autospec working with cucumber it's very nice to follow
something like:
write up your cucumber feature
watch it fail
write up your rspec controller test
watch it fail
make your rspec test pass
make your cucumber test pass
autospec won't rerun the cucumber tests until the rspec ones are passing,
it's quite clever like that.
I'd say most of my controllers don't have test. The integration testing
that cucumber provides is really nice and done correctly can give you
massive amounts of confidence your code works like you want. I just like to
have some controller tests in there every now and again for things that I
think are a little bit too complex.
Check out the rspec book too from pragprog.com, I quite liked it and has
lots of cucumber in it too.
On 8 February 2010 22:02, <a class="moz-txt-link-rfc2396E" href="mailto:chat-request@lists.lrug.org"><chat-request@lists.lrug.org></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Send Chat mailing list submissions to
<a class="moz-txt-link-abbreviated" href="mailto:chat@lists.lrug.org">chat@lists.lrug.org</a>
To subscribe or unsubscribe via the World Wide Web, visit
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
or, via email, send a message with subject or body 'help' to
<a class="moz-txt-link-abbreviated" href="mailto:chat-request@lists.lrug.org">chat-request@lists.lrug.org</a>
You can reach the person managing the list at
<a class="moz-txt-link-abbreviated" href="mailto:chat-owner@lists.lrug.org">chat-owner@lists.lrug.org</a>
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Chat digest..."
Today's Topics:
1. Cucumber and RSpec on Rails (Jordi Noguera Leon)
2. Another Recruitment Shout-Out (Hakan ?enol Ensari)
3. Re: Cucumber and RSpec on Rails (Paul Campbell)
4. Re: Cucumber and RSpec on Rails (Steven Mohapi-Banks)
---------- Forwarded message ----------
From: Jordi Noguera Leon <a class="moz-txt-link-rfc2396E" href="mailto:jordinoguera83@gmail.com"><jordinoguera83@gmail.com></a>
To: London Ruby Users Group <a class="moz-txt-link-rfc2396E" href="mailto:chat@lists.lrug.org"><chat@lists.lrug.org></a>
Date: Mon, 8 Feb 2010 19:42:48 +0000
Subject: [LRUG] Cucumber and RSpec on Rails
Hi there!
I'm starting with Cucumber but I'm not sure if/when/how to create specs.
In the couple of Railscasts I'seen so far, the guy generates rspec_models
and rspec_controllers, but he doesn't code anything inside them... In
another screencast I've seen, the guy validates uniqueness of some stuff
inside the spec, but I guess that's something you could do using a
scenario, right? Basically, do I need to write any spec or I can do all the
stuff in the scenario?
Regards,
Jordi
---------- Forwarded message ----------
From: "Hakan ?enol Ensari" <a class="moz-txt-link-rfc2396E" href="mailto:hakan.ensari@papercavalier.com"><hakan.ensari@papercavalier.com></a>
To: London Ruby Users Group <a class="moz-txt-link-rfc2396E" href="mailto:chat@lists.lrug.org"><chat@lists.lrug.org></a>
Date: Mon, 8 Feb 2010 19:51:16 +0000
Subject: [LRUG] Another Recruitment Shout-Out
Hi everyone,
My apologies for spamming.
My company is looking for a full-time Ruby dev in London. Here are the
details:
<a class="moz-txt-link-freetext" href="http://papercavalier.com/jobs">http://papercavalier.com/jobs</a>
Cheers,
Hakan
<a class="moz-txt-link-freetext" href="http://ultra.bohe.me">http://ultra.bohe.me</a>
---------- Forwarded message ----------
From: Paul Campbell <a class="moz-txt-link-rfc2396E" href="mailto:paul@rslw.com"><paul@rslw.com></a>
To: London Ruby Users Group <a class="moz-txt-link-rfc2396E" href="mailto:chat@lists.lrug.org"><chat@lists.lrug.org></a>
Date: Mon, 8 Feb 2010 19:57:37 +0000
Subject: Re: [LRUG] Cucumber and RSpec on Rails
Jordi,
cucumber can (and will, if you want) cover 90% of the cases.
Sometimes you might want to drop down to controller testing for edge
cases or redirects to external services and things.
Mostly though, my controller specs remain empty.
Model specs are much more frequent though, for testing things like
arithmetic, maybe validations, auto-assignment, data transformations
etc.
Hope this helps,
?Paul
On Mon, Feb 8, 2010 at 7:42 PM, Jordi Noguera Leon
<a class="moz-txt-link-rfc2396E" href="mailto:jordinoguera83@gmail.com"><jordinoguera83@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi there!
I'm starting with Cucumber but I'm not sure if/when/how to create
</pre>
</blockquote>
<pre wrap="">specs. In
</pre>
<blockquote type="cite">
<pre wrap="">the couple of Railscasts I'seen so far, the guy generates rspec_models
</pre>
</blockquote>
<pre wrap="">and
</pre>
<blockquote type="cite">
<pre wrap="">rspec_controllers, but he doesn't code anything inside them... In
</pre>
</blockquote>
<pre wrap="">another
</pre>
<blockquote type="cite">
<pre wrap="">screencast I've seen, the guy validates uniqueness of some stuff inside
</pre>
</blockquote>
<pre wrap="">the
</pre>
<blockquote type="cite">
<pre wrap="">spec, but I guess that's something you could do using a scenario,
</pre>
</blockquote>
<pre wrap="">right?
</pre>
<blockquote type="cite">
<pre wrap="">Basically, do I need to write any spec or I can do all the stuff in the
scenario?
Regards,
Jordi
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
--
Paul Campbell
<a class="moz-txt-link-abbreviated" href="mailto:paul@rushedsunlight.com">paul@rushedsunlight.com</a>
- - - - - - - - - - - - - - - - - - -
blog <a class="moz-txt-link-freetext" href="http://www.pabcas.com">http://www.pabcas.com</a>
twitter <a class="moz-txt-link-freetext" href="http://www.twitter.com/paulca">http://www.twitter.com/paulca</a>
github <a class="moz-txt-link-freetext" href="http://www.github.com/paulca">http://www.github.com/paulca</a>
phone +353 87 914 8162
- - - - - - - - - - - - - - - - - - -
---------- Forwarded message ----------
From: Steven Mohapi-Banks <a class="moz-txt-link-rfc2396E" href="mailto:steven.mohapibanks@me.com"><steven.mohapibanks@me.com></a>
To: London Ruby Users Group <a class="moz-txt-link-rfc2396E" href="mailto:chat@lists.lrug.org"><chat@lists.lrug.org></a>
Date: Mon, 08 Feb 2010 21:40:35 +0000
Subject: Re: [LRUG] Cucumber and RSpec on Rails
I'd pretty much agree with this - my controller specs these days are
pretty much for covering access privileges, security edge cases and the
like. I also spec out routing rules quite frequently. Everything else goes
in Cucumber stories.
Steve
On Monday, February 08, 2010, at 07:57PM, "Paul Campbell" <a class="moz-txt-link-rfc2396E" href="mailto:paul@rslw.com"><paul@rslw.com></a>
wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Jordi,
cucumber can (and will, if you want) cover 90% of the cases.
Sometimes you might want to drop down to controller testing for edge
cases or redirects to external services and things.
Mostly though, my controller specs remain empty.
Model specs are much more frequent though, for testing things like
arithmetic, maybe validations, auto-assignment, data transformations
etc.
Hope this helps,
?Paul
On Mon, Feb 8, 2010 at 7:42 PM, Jordi Noguera Leon
<a class="moz-txt-link-rfc2396E" href="mailto:jordinoguera83@gmail.com"><jordinoguera83@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi there!
I'm starting with Cucumber but I'm not sure if/when/how to create
</pre>
</blockquote>
</blockquote>
<pre wrap="">specs. In
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">the couple of Railscasts I'seen so far, the guy generates rspec_models
</pre>
</blockquote>
</blockquote>
<pre wrap="">and
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">rspec_controllers, but he doesn't code anything inside them... In
</pre>
</blockquote>
</blockquote>
<pre wrap="">another
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">screencast I've seen, the guy validates uniqueness of some stuff
</pre>
</blockquote>
</blockquote>
<pre wrap="">inside the
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">spec, but I guess that's something you could do using a scenario,
</pre>
</blockquote>
</blockquote>
<pre wrap="">right?
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Basically, do I need to write any spec or I can do all the stuff in
</pre>
</blockquote>
</blockquote>
<pre wrap="">the
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">scenario?
Regards,
Jordi
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
--
Paul Campbell
<a class="moz-txt-link-abbreviated" href="mailto:paul@rushedsunlight.com">paul@rushedsunlight.com</a>
- - - - - - - - - - - - - - - - - - -
blog <a class="moz-txt-link-freetext" href="http://www.pabcas.com">http://www.pabcas.com</a>
twitter <a class="moz-txt-link-freetext" href="http://www.twitter.com/paulca">http://www.twitter.com/paulca</a>
github <a class="moz-txt-link-freetext" href="http://www.github.com/paulca">http://www.github.com/paulca</a>
phone +353 87 914 8162
- - - - - - - - - - - - - - - - - - -
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100209/ba2ef59c/attachment-0001.htm"><http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100209/ba2ef59c/attachment-0001.htm></a>
------------------------------
Message: 2
Date: Tue, 09 Feb 2010 09:42:55 +0000
From: Joseph Wilk <a class="moz-txt-link-rfc2396E" href="mailto:joe@josephwilk.net"><joe@josephwilk.net></a>
To: <a class="moz-txt-link-abbreviated" href="mailto:chat@lists.lrug.org">chat@lists.lrug.org</a>
Subject: Re: [LRUG] Cucumber and RSpec on Rails
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:4B712E1F.1050904@josephwilk.net"><4B712E1F.1050904@josephwilk.net></a>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 08/02/2010 19:42, Jordi Noguera Leon wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi there!
I'm starting with Cucumber but I'm not sure if/when/how to create
</pre>
</blockquote>
<pre wrap="">specs. In the couple of Railscasts I'seen so far, the guy generates
rspec_models and rspec_controllers, but he doesn't code anything inside
them... In another screencast I've seen, the guy validates uniqueness of
some stuff inside the spec, but I guess that's something you could do
using a scenario, right? Basically, do I need to write any spec or I
can do all the stuff in the scenario?
Hello,
While there is not a fit all rule, it comes down to considering a couple
of points:
1. Complexity/Distance/Focus
The scenario focuses on the real value realised by the system (the
output), there can often be quite a distance between the implementation
and the output. Hence you're failing feature might leave you very
stumped as to what is wrong/what to do next. You may also have complex
logic that you feel like needs more developer focused tests and feedback
(a tighter feedback loop). In these cases specs can help you out.
2. Speed
In Cucumber we try and exercise the entire application stack and avoid
mocking where possible. As a consequence things can get slow. If running
a cucumber scenario takes 4/5 minutes that could significantly slow down
your development cycle (While it still as a test has a lot of value
testing everything interacts nicely). Hence you might drop down to a
spec and stub out an area of the system to help achieve faster feedback
(not that is the only reason to stub, it all helps achieve focus as we
can isolate from the other systems we don't care about.)
3. Fragility
In my experience Features/Cucumber tend to live longer than specs. When
I have performed major refactoring some of the specs tended to be thrown
away while the features stuck around (the step defs may however have
changed). That does not mean the specs weren't useful, just something to
think about.
4. Personal taste
Some people Just Cuke, some people just spec and some people do both.
For me personally I use both, that does not mean its the right way for
you. Play around and get a feel for how you want to use these tools.
HTH
--
Joseph Wilk
<a class="moz-txt-link-freetext" href="http://blog.josephwilk.net">http://blog.josephwilk.net</a>
+44 (0)7812 816431
</pre>
<blockquote type="cite">
<pre wrap="">
Regards,
Jordi
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">
------------------------------
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
End of Chat Digest, Vol 49, Issue 11
************************************
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<pre wrap="">_______________________________________________
Chat mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a>
</pre>
</blockquote>
<br>
</body>
</html>