Another approach to what Pat mentioned is would be to use a presenter
approach. We use presenters to encapsulate view logic and they often
hide (or delegate) functionality to one or more models based on the UI
component you're focusing on.
This route doesn't muck up your models with things that
Not if you fill it out...and the BDD way is to write one example at a
time, not a complete spec beforehand.
I've done it this way too (being lazy), but is it really good thing?
Often I get more insight on how an interface should look like,
if I think even superficially what kinds of services an
in my latest blog posting
:http://talklikeaduck.denhaven2.com/articles/2008/01/29/why-i-dont-mind-using-rspec-in-fact-ive-come-to-love-it
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
___
rspec-users mailing list
Very nice post, Rick.
I, too, would like to hear what people mean when they say it is too
magical. I kind of like the magic. :)
-Corey
On Jan 29, 2008 5:03 PM, Rick DeNatale [EMAIL PROTECTED] wrote:
in my latest blog posting
:
Warning - bit of a ramble below!
On 29/01/2008, Edvard Majakari [EMAIL PROTECTED] wrote:
Not if you fill it out...and the BDD way is to write one example at a
time, not a complete spec beforehand.
I've done it this way too (being lazy), but is it really good thing?
Often I get more
oh, I left in:
it should return an error when passed a string do
@audience.stats = 'Market Goblin'
lambda [EMAIL PROTECTED] = 'Market Goblin'}.should raise_error
end
when yours is:
it should return an error when passed a string do
lambda [EMAIL PROTECTED] = 'Market
-1*
I upgraded a Rails project from rspec 0.9 to 1.1.2 -- and this change caused
me some pain. Luckily, I figured it out and confirmed it here on the list
before things got too bad. :)
* That said, I have to admit that I'm not super-pleased about my helper
methods that start with should_ -- they
I love rspec. I wish the magic extended to ruby 1.9 so I could start
looking at 1.9 with spec support. I'd rather not learn bacon + mocha
just to work with 1.9, only to port back to rspec once 1.9 support is
done. Just my $0.02 though.
On Jan 29, 2008 4:26 PM, Corey Haines [EMAIL PROTECTED]
Andrew WC Brown wrote:
oh, I left in:
it should return an error when passed a string do
@audience.stats = 'Market Goblin'
lambda [EMAIL PROTECTED] = 'Market Goblin'}.should raise_error
end
when yours is:
it should return an error when passed a string do
lambda
So if I understand correctly,
The following didn't raise an error:
@audience.stats = 'Market Goblin'
@audience.stats.should raise_error
because audience.stats didn't return an error.
Where as lambda will return an error.
On Jan 29, 2008 10:58 PM, Ben Mabey [EMAIL PROTECTED] wrote:
Andrew WC
On Jan 29, 2008 8:48 PM, James B. Byrne [EMAIL PROTECTED] wrote:
Message-ID:[EMAIL PROTECTED]
On: Tue, 29 Jan 2008 20:47:41 -0500, Andrew WC Brown [EMAIL PROTECTED]
wrote:
I've seen lambda before but not sure what it does.
A lambda is a fancy name for an anonymous or unbound function.
Sematics.. the method is never returning an error, it raises one. So
you can't say @audience.stats=dsfds and expect to see an exception
returned right?
Since an exception is being raised you have to think of another way of
testing it aside from checking it's return value... So you could do
lawl, David has been out of the loop a few e-mails.I left in an extra line.
Thanks for the expansion Ben, adds much more clarity,
On Jan 29, 2008 8:03 PM, David Chelimsky [EMAIL PROTECTED] wrote:
On Jan 29, 2008 6:55 PM, Andrew WC Brown [EMAIL PROTECTED] wrote:
try it, does the same thing
On Jan 29, 2008 6:55 PM, Andrew WC Brown [EMAIL PROTECTED] wrote:
try it, does the same thing ='(
Shouldn't be the exact same thing. What's the whole error?
Also - what version of rspec? If trunk, do you have the latest (3268)?
On Jan 29, 2008 7:49 PM, Shane Mingins [EMAIL PROTECTED]
Hey Ben,
That makes perfect sense. Thanks for pointing out the error because I
don't think I would've been able to figure it out.
Thanks, as well, for the stubbing/mocking tip. I will keep my eyes open
for that in the future.
--
Posted via http://www.ruby-forum.com/.
15 matches
Mail list logo