On Thu, Feb 19, 2009 at 11:38 AM, Mark Wilden wrote:
> On Wed, Feb 18, 2009 at 9:40 PM, Stephen Eley wrote:
>> On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen wrote:
>>
>> validates_presence_of happens to be the name of the method in
>> ActiveRecord that does that. But if you decide to write your own
On Thu, Feb 19, 2009 at 10:55 AM, David Chelimsky wrote:
>
> This is where this all gets tricky.
Yep. >8->
> TDD (remember? that's where this all started) says you don't write any
> subject code without a failing *unit test*. This is not about the end
> result - it's about a process. What you'
On Wed, Feb 18, 2009 at 9:40 PM, Stephen Eley wrote:
> On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen wrote:
>
> validates_presence_of happens to be the name of the method in
> ActiveRecord that does that. But if you decide to write your own
> check_to_see_if_this_thingy_is_in_my_whatsis() method that
On Thu, Feb 19, 2009 at 12:15 PM, Stephen Eley wrote:
>
> But I did not write any code yet setting the message. Because I
> haven't written any tests for the message. At this point I don't care
> what the message is, just that I have the right data. I care about
> the message when I start focus
On Thu, Feb 19, 2009 at 9:55 AM, David Chelimsky wrote:
> On Wed, Feb 18, 2009 at 11:40 PM, Stephen Eley wrote:
>
>
>> If your spec breaks because you changed a method call, you're not
>> testing behavior any more. You're testing syntax.
>
>
> We've got to stop making laws out of guidelines. T
On Thu, Feb 19, 2009 at 10:41 AM, Yi Wen wrote:
> Good point, that's actually I am debating with myself everyday and haven't
> got a clear answer. This is classical "calssic unit tester" vs. mockist war.
> :)
>
> Talking about this case:
>
> 1. I haven't checked how should valite_presence_of is im
On Thu, Feb 19, 2009 at 8:20 AM, Stephen Eley wrote:
> On Thu, Feb 19, 2009 at 12:58 AM, David Chelimsky
> wrote:
>>
>>> Also, while I used to be very anal and write "should
>>> have(1).error_on(:login)" and such, I eventually realized that there's
>>> no point. Checking on 'valid?' is entire a
Good point, that's actually I am debating with myself everyday and haven't
got a clear answer. This is classical "calssic unit tester" vs. mockist war.
:)
Talking about this case:
1. I haven't checked how should valite_presence_of is implemented, but it
could pretty much be checking if the value
On Thu, Feb 19, 2009 at 12:31 AM, Stephen Eley wrote:
> On Wed, Feb 18, 2009 at 10:42 PM, Mark Wilden wrote:
>> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>>
>>> What's the point in testing validates_presence_of for a model?
>>
>> To make sure you wrote that line of code.
>
> And th
On Wed, Feb 18, 2009 at 11:40 PM, Stephen Eley wrote:
> If your spec breaks because you changed a method call, you're not
> testing behavior any more. You're testing syntax.
We've got to stop making laws out of guidelines. This is a very
general statement about what is really a very specific
On Thu, Feb 19, 2009 at 12:58 AM, David Chelimsky wrote:
>
>> Also, while I used to be very anal and write "should
>> have(1).error_on(:login)" and such, I eventually realized that there's
>> no point. Checking on 'valid?' is entire and sufficient.
>
> I think this depends on whether or not error
Dave, you make a good point. In our system, where we are converting a
legacy database/application, we typically have no user stories and have
the technical (or you could argue user) requirement that the database
logic / constraints get converted. This is where we are typically just
encoding all
> Wrong. You don't have to test validates_presence_of. What matters,
> and therefore what you should test, is whether the model will complain
> at you if a particular value is left empty.
> ...
> If your spec breaks because you changed a method call, you're not
> testing behavior any more. You'r
On 19 Feb 2009, at 05:40, Stephen Eley wrote:
On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen wrote:
Without this syntax sugar, we still have to test
validates_presence_of to
make sure it's there and won't broken, right?
Wrong. You don't have to test validates_presence_of. What matters,
and
On Wed, Feb 18, 2009 at 11:31 PM, Stephen Eley wrote:
> On Wed, Feb 18, 2009 at 10:42 PM, Mark Wilden wrote:
>> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>>
>>> What's the point in testing validates_presence_of for a model?
>>
>> To make sure you wrote that line of code.
>
> And th
On Wed, Feb 18, 2009 at 11:42 PM, Yi Wen wrote:
>
> Without this syntax sugar, we still have to test validates_presence_of to
> make sure it's there and won't broken, right?
Wrong. You don't have to test validates_presence_of. What matters,
and therefore what you should test, is whether the mod
Pat, not nitpicking just using your eample, which was close, but you
missed one of the reasons we like shoulda type tests::
should_require_attributes :body, :message => /wtf/
makes you put
validates_presence_of :body, :message => "hey dude, wtf, you need a body!"
because we have a bunch of cu
On Wed, Feb 18, 2009 at 10:42 PM, Mark Wilden wrote:
> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>
>> What's the point in testing validates_presence_of for a model?
>
> To make sure you wrote that line of code.
And the circle spins round and round...
Specs that mirror the code tha
We should write a test/spec, whatever you call it, *first* before you want
your code. But it doesn't mean one who writes the spec/test will use a
monkey coding the code to fix the test. To be realistic, a programmer will
write this test, and implement it right away. Just like how TDD should be
done
On Wed, Feb 18, 2009 at 9:45 PM, Pat Maddox wrote:
> On Wed, Feb 18, 2009 at 7:42 PM, Mark Wilden wrote:
>> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
I should be able to write:
describe User do
it {should valdate_presence_of(:login)}
end
>>>
>>> What'
On Wed, Feb 18, 2009 at 6:06 PM, Zach Dennis wrote:
> On Wed, Feb 18, 2009 at 7:39 PM, Fernando Perez wrote:
>> Yi Wen wrote:
>>> Hello,
>>>
>>> according to this post:
>>> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>>>
>>> I should be able to write:
>>>
>>> describe User d
On 19/02/2009, at 14:05 , David Chelimsky wrote:
Why not start w/ RSpec but do it right?
I made the mistake of showing the guy a spec from a previous project
and narrating (not showing) how the code was built from the spec. So
the manager didn't realise that the spec was built one line at
On Wed, Feb 18, 2009 at 7:42 PM, Mark Wilden wrote:
> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>>
>>> I should be able to write:
>>>
>>> describe User do
>>> it {should valdate_presence_of(:login)}
>>> end
>>
>> What's the point in testing validates_presence_of for a model?
>
> T
On Wed, Feb 18, 2009 at 9:42 PM, Mark Wilden wrote:
> On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>>
>>> I should be able to write:
>>>
>>> describe User do
>>> it {should valdate_presence_of(:login)}
>>> end
>>
>> What's the point in testing validates_presence_of for a model?
>
> T
On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
>>
>> I should be able to write:
>>
>> describe User do
>> it {should valdate_presence_of(:login)}
>> end
>
> What's the point in testing validates_presence_of for a model?
To make sure you wrote that line of code.
///ark
_
On Wed, Feb 18, 2009 at 9:02 PM, Alex Satrapa wrote:
> On 19/02/2009, at 13:02 , Zach Dennis wrote:
>
>> I have never seen or heard of anyone who writes a spec (developer
>> level RSpec spec), but not the code and then hands it over to someone
>> else and demands that that person implements it.
>
On 19/02/2009, at 13:02 , Zach Dennis wrote:
I have never seen or heard of anyone who writes a spec (developer
level RSpec spec), but not the code and then hands it over to someone
else and demands that that person implements it.
The fun begins when you can point out two or three conflicting
On Feb 18, 2009, at 7:39 PM, Fernando Perez wrote:
Yi Wen wrote:
Hello,
according to this post:
http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
I should be able to write:
describe User do
it {should valdate_presence_of(:login)}
end
What's the point in testing validates_
On Wed, Feb 18, 2009 at 7:39 PM, Fernando Perez wrote:
> Yi Wen wrote:
>> Hello,
>>
>> according to this post:
>> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>>
>> I should be able to write:
>>
>> describe User do
>> it {should valdate_presence_of(:login)}
>> end
>
> What's
On Wed, Feb 18, 2009 at 8:47 PM, Alex Satrapa wrote:
> On 19/02/2009, at 11:39 , Fernando Perez wrote:
>
>> What's the point in testing validates_presence_of for a model? It's
>> already tested in the framework, and so readable that a quick glance on
>> the model says it all.
>
> Some people want
On 19/02/2009, at 11:39 , Fernando Perez wrote:
What's the point in testing validates_presence_of for a model? It's
already tested in the framework, and so readable that a quick glance
on
the model says it all.
Some people want the spec to stand as a contract, so you can then hand
the spe
On Wed, Feb 18, 2009 at 7:39 PM, Fernando Perez wrote:
> Yi Wen wrote:
>> Hello,
>>
>> according to this post:
>> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>>
>> I should be able to write:
>>
>> describe User do
>> it {should valdate_presence_of(:login)}
>> end
>
> What's
On Wed, Feb 18, 2009 at 4:39 PM, Fernando Perez wrote:
> Yi Wen wrote:
>> Hello,
>>
>> according to this post:
>> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>>
>> I should be able to write:
>>
>> describe User do
>> it {should valdate_presence_of(:login)}
>> end
>
> What's
Yi Wen wrote:
> Hello,
>
> according to this post:
> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>
> I should be able to write:
>
> describe User do
> it {should valdate_presence_of(:login)}
> end
What's the point in testing validates_presence_of for a model? It's
alrea
On Tue, Feb 17, 2009 at 8:42 PM, Yi Wen wrote:
> ah! sorry, my bad. Thanks!
No worries - I always just read the code first too :)
>
> On Tue, Feb 17, 2009 at 6:56 PM, David Chelimsky
> wrote:
>>
>> On Tue, Feb 17, 2009 at 6:25 PM, Yi Wen wrote:
>> > Sorry for the spam, I relized there was a ty
ah! sorry, my bad. Thanks!
On Tue, Feb 17, 2009 at 6:56 PM, David Chelimsky wrote:
> On Tue, Feb 17, 2009 at 6:25 PM, Yi Wen wrote:
> > Sorry for the spam, I relized there was a typo. It should be
> >it {should validate_presence_of(:login)}
> > It still didn't work
>
> Scrolling up a bit
according to this post:
http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
I should be able to write:
describe User do
it {should valdate_presence_of(:login)}
end
with rspec 1.1.12
But I got:
NO NAME
undefined method `valdate_presence_of' for
#
Hi Yi,
I believe you're
On Tue, Feb 17, 2009 at 6:25 PM, Yi Wen wrote:
> Sorry for the spam, I relized there was a typo. It should be
>it {should validate_presence_of(:login)}
> It still didn't work
Scrolling up a bit ...
"There are a few matcher libraries out there like
rspec-on-rails-matchers that provide m
Sorry for the spam, I relized there was a typo. It should be
it {should validate_presence_of(:login)}
It still didn't work
On Tue, Feb 17, 2009 at 6:04 PM, Yi Wen wrote:
> Hello,
>
> according to this post:
> http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
>
> I should b
Hello,
according to this post:
http://blog.davidchelimsky.net/2009/1/13/rspec-1-1-12-is-released
I should be able to write:
describe User do
it {should valdate_presence_of(:login)}
end
with rspec 1.1.12
But I got:
NO NAME
undefined method `valdate_presence_of' for
#
What did I do it wrong?
40 matches
Mail list logo