On Aug 25, 2009, at 1:09 AM, jg wrote:
I have a very fairly simple spec
it "should assign an instance variable" do
get 'new'
assigns[:city].should == City.new
end
In my controller
def new
@city = City.new
end
but when I run it, I get
'CitiesController GET 'new' should assign an instanc
Ahh, got it! Thanks alot guys.
On Aug 25, 2:09 am, Christoph Schiessl wrote:
> On Aug 25, 2009, at 1:09 AM, jg wrote:
>
>
>
>
>
> > I have a very fairly simple spec
>
> > it "should assign an instance variable" do
> > get 'new'
> > assigns[:city].should == City.new
> > end
>
> > In my control
This isn't really an rspec question, but about mocks and stubs in
general, and maybe I'm looking for some best practices with rspec.
I like mocks and stubs until code starts to change, and then I always
get frustrated because examples then seem so brittle and sensitive to
implementation detail
On 25 Aug 2009, at 18:12, Denis Haskin wrote:
The key expectation in this example is:
@discount.should_not be_available(@order)
But I changed the implementation of Discount#available? so that it
calls Order#num_products instead of Order#line_items. My examples
now fail.
Why am I havin
Tom -- perfect. That's exactly the kind of explanation I was looking
for, and now I can go and deal with these changes with a worry-free mind.
I find it too easy to forget that a class's public methods are, in fact,
an API (particularly when there are no libraries involved) and need to
be tes
Yep. That's why most people who are uncomfortable with mocks are
uncomfortable with mocks.
In my experience mocks work best at well-defined, relatively stable
interfaces to external(ish) services. Otherwise you're testing the
implementation, which makes refactoring difficult. But there are lots
of
I am trying to process a message sent to a mock to verify it contains
the correct keys. In my case I am sending a JSON string to the mock
built from data passed in via the test. The object internally builds a
hash and then constructs the JSON string from it.
I can't get my mock to fail thou
Chuck Remes wrote:
I am trying to process a message sent to a mock to verify it contains
the correct keys. In my case I am sending a JSON string to the mock
built from data passed in via the test. The object internally builds a
hash and then constructs the JSON string from it.
I can't get my
On 25 Aug 2009, at 20:59, Chuck Remes wrote:
The documentation says the expectation passes or fails based upon
the return value of the block. I can't even force it to fail by
returning false.
The docs (http://rspec.info/documentation/mocks/message_expectations.html
) say:
You can supply a
On Aug 25, 2009, at 6:39 PM, Joaquin Rivera Padron wrote:
hey there,
I have a question that may be raised from some misunderstanding of
my current problem. But the answer might well serve me for other
things.
The issue is I would like to be able to metaprogramatically (this
may be a bad
hey scott,
thanks for your answer, but I still don't seem to get the 'contextual' part
of the validations
I am missing something? (it's maybe thay I should get some sleep)
cheers,
joaquin
___
rspec-users mailing list
rspec-users@rubyforge.org
http://ruby
hey there,
I have a question that may be raised from some misunderstanding of my
current problem. But the answer might well serve me for other things.
The issue is I would like to be able to metaprogramatically (this may be a
bad chosen word) generate spec examples to check a model is valid again
Hello,
I'm struggling with this controller spec for a few hours now
http://pastie.org/594775
which is failing with an error I can't find any references about,
neither on the list nor on the web in general:
Admin::ImagesController handling PUT /images/1 with successful update
should find the ima
any clues?
On Aug 21, 1:13 pm, oren wrote:
> When running autotest only 'rake spec' is running
> and I want it to run 'rake spec:remote' as well.
>
> How do i achieve that?
>
> thanks
> ___
> rspec-users mailing list
> rspec-us...@rubyforge.orghttp://ru
oren wrote:
When running autotest only 'rake spec' is running
and I want it to run 'rake spec:remote' as well.
How do i achieve that?
IIRC, autospec (not autotest) does not use rake at all. It uses the
opts defined in spec/spec.opts. I would suggest making any needed
changes in that fi
15 matches
Mail list logo