I want to mock to Model.to_xml but not his block. How to do it?
Here is what I have (sorry for the formatting)
output = @detenteur.to_xml( :skip_types => false, :skip_instruct
=> true, :dasherize => false, :only => [:inte_no] ) do |xml_detenteur|
p xml_detenteur.intervenant_adresse
Hi,
I have a recursive method and I want to mock a var passed by ref.
Object.should_receive(:my_method).and_return"by_ref"(@value)
Something like that.
Any idea?
Rémi
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/
On Sun, Feb 8, 2009 at 6:48 AM, Remi Gagnon wrote:
> Hi,
>
> I have a recursive method and I want to mock a var passed by ref.
> Object.should_receive(:my_method).and_return"by_ref"(@value)
>
> Something like that.
>
> Any idea?
AFAIK, Ruby has no language construct for "by_ref/by_val," so I'm no
On Sun, Feb 8, 2009 at 6:44 AM, Remi Gagnon wrote:
> I want to mock to Model.to_xml but not his block. How to do it?
>
> Here is what I have (sorry for the formatting)
>
> output = @detenteur.to_xml( :skip_types => false, :skip_instruct =>
> true, :dasherize => false, :only => [:inte_no] )
I started writing up a response about why I wrote Fixjour, and why I
want it to be its own project, but it got really long. Here's a
Markdownified gist: http://gist.github.com/60389.
For the record, I think FR is a great tool (I link to it in Fixjour's
README), it's just not for me. Read the gist
Hello,
This is a question from one of my teammate, I'll revalidate tomorrow with
him what is his issue.
Thank you
Rémi
On Sun, Feb 8, 2009 at 10:02 AM, David Chelimsky wrote:
> On Sun, Feb 8, 2009 at 6:48 AM, Remi Gagnon wrote:
> > Hi,
> >
> > I have a recursive method and I want to mock a va
On 07/02/2009, at 10:45 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman
wrote:
On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman
wrote:
When writing Cucumber stories and features for controllers,
should you
cover
ev
On 08/02/2009, at 7:44 AM, Remi Gagnon wrote:
I want to mock to Model.to_xml but not his block. How to do it?
Here is what I have (sorry for the formatting)
output = @detenteur.to_xml( :skip_types =>
false, :skip_instruct => true, :dasherize => false, :only =>
[:inte_no] ) do |xml_de
On Sun, Feb 8, 2009 at 9:22 AM, Nick Hoffman wrote:
> On 07/02/2009, at 10:45 PM, David Chelimsky wrote:
>>
>> On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman wrote:
>>>
>>> On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman
wrote:
>
>>
On Sun, Feb 8, 2009 at 9:49 AM, David Chelimsky wrote:
> On Sun, Feb 8, 2009 at 9:22 AM, Nick Hoffman wrote:
>> On 07/02/2009, at 10:45 PM, David Chelimsky wrote:
>>>
>>> On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman wrote:
On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
>
> O
Groovy!Cheers,
Doug.
2009/2/7 David Chelimsky
> On Sat, Feb 7, 2009 at 10:20 AM, Pat Maddox wrote:
> > On Sat, Feb 7, 2009 at 3:16 AM, doug livesey wrote:.
> >
> > def do_get
> > get :index, :format => "xml"
> > end
> >
> > should work. Notice it's a string instead of symbol.
>
> I should
David Chelimsky wrote:
On Sun, Feb 8, 2009 at 9:22 AM, Nick Hoffman wrote:
On 07/02/2009, at 10:45 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman wrote:
On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 9:59 AM, Nick Ho
Jim Morris wrote:
Yet another way to do fixtures/factories is a hybrid that I outline in
my blog, its basically what I do.
http://blog.wolfman.com/posts/42
Basically I can't use the existing libraries as I am not using
ActiveRecord.
I'd be interested in supporting Datamapper, Sequel, and t
Pat Nakajima wrote:
I started writing up a response about why I wrote Fixjour, and why I
want it to be its own project, but it got really long. Here's a
Markdownified gist: http://gist.github.com/60389.
For the record, I think FR is a great tool (I link to it in Fixjour's
README), it's just not
On 7 Feb 2009, at 19:02, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 12:27 PM, Pat Maddox wrote:
On Sat, Feb 7, 2009 at 9:30 AM, Nick Hoffman
wrote:
With that said, I'm wondering what the accepted way to setup gem
dependencies on rspec and rspec-rails is. Should one not bother?
Should
Remi Gagnon wrote:
Hi,
I have a recursive method and I want to mock a var passed by ref.
Object.should_receive(:my_method).and_return"by_ref"(@value)
Often a way to spec a recursive function is to alias it, and have the
recursive call call the alias. So if you want to check the recursion,
Which version of cucumber / webrat are you using?
On 6 Feb 2009, at 17:12, Jeff Talbot wrote:
Hello,
I have a controller action that raises a RecordNotFound exception if
you're not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
Just saw this twitter by and thought people might be interested:
http://msdn.microsoft.com/en-us/magazine/dd434651.aspx
Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforg
I think that named fixtures are primarily a matter of taste. With that being
said, I did want to explain mine a bit.
> When extra attributes are needed as well, I think the test can become too
> busy.
>
A lot of time, I feel like processing the overrides hash is just a bandaid
over something mis
how could this test pass?
I have:
class PropertiesController < ApplicationController
def show
@property = Property.non_existing_method #causes a method missing
error
end
end
describe PropertiesController do
def mock_property(stubs={})
@mock_property ||= mock_model(Property, stub
On Sun, Feb 8, 2009 at 5:35 PM, Sergio Bayona wrote:
> how could this test pass?
>
> I have:
>
> class PropertiesController < ApplicationController
> def show
>@property = Property.non_existing_method #causes a method missing
> error
> end
> end
>
>
> describe PropertiesController do
> def
On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona wrote:
> how could this test pass?
>
> I have:
>
> class PropertiesController < ApplicationController
> def show
>@property = Property.non_existing_method #causes a method missing
> error
> end
> end
>
>
> describe PropertiesController do
> def
On Sun, Feb 8, 2009 at 7:35 PM, Sergio Bayona wrote:
> how could this test pass?
>
> I have:
>
> class PropertiesController < ApplicationController
> def show
>@property = Property.non_existing_method #causes a method missing
> error
> end
> end
>
>
> describe PropertiesController do
> def
Sergio Bayona wrote:
> how could this test pass?
>
> I have:
>
> class PropertiesController < ApplicationController
...
> why zero failures? more specifically, why would :non_existing_method
> return mock_property? and why would the assigns[:property] be equal to
> mock_property? did I eat some
Aslak Hellesøy wrote:
> On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona
> wrote:
>>
>>assigns[:property].should equal(mock_property)
>> 1 example, 0 failures
>>
>>
>> why zero failures? more specifically, why would :non_existing_method
>> return mock_property?
>
> Because you have stubbed
2009/2/8 Sergio Bayona
> how could this test pass?
>
> I have:
>
> class PropertiesController < ApplicationController
> def show
>@property = Property.non_existing_method #causes a method missing
> error
> end
> end
>
>
> describe PropertiesController do
> def mock_property(stubs={})
>
On Sun, Feb 8, 2009 at 8:54 PM, Sergio Bayona wrote:
> Aslak Hellesøy wrote:
>> On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona
>> wrote:
>>>
>>>assigns[:property].should equal(mock_property)
>>> 1 example, 0 failures
>>>
>>>
>>> why zero failures? more specifically, why would :non_existing
On Sun, Feb 8, 2009 at 6:54 PM, Sergio Bayona wrote:
> > On Mon, Feb 9, 2009 at 2:35 AM, Sergio Bayona
> > wrote:
> >>
> >>assigns[:property].should equal(mock_property)
> >> 1 example, 0 failures
> >>
> >>
> >> why zero failures? more specifically, why would :non_existing_method
> >> re
On Sun, Feb 8, 2009 at 6:09 PM, Matías Flores wrote:
>
> You can find more info at
> http://rspec.info/documentation/mocks/message_expectations.html.
>
On that page, I found this example of using a computed return value
with an expectation:
my_mock.should_receive(:msg).with(:numeric, :numeric)
29 matches
Mail list logo