Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread David Chelimsky
On Nov 1, 2010, at 4:47 PM, Alexey Ilyichev wrote: > > In RSpec-2 it raises an informative error, so I think this is what we > should do in RSpec-1. Would you like to submit a patch to make it do > that? > > > Sure. Attaching a patch. Also submitted a pull request on github - whatever. > _

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread Alexey Ilyichev
> In RSpec-2 it raises an informative error, so I think this is what we > should do in RSpec-1. Would you like to submit a patch to make it do > that? > > Sure. Attaching a patch. Also submitted a pull request on github - whatever. From 030d8e7590ed69c4ddee70b9ea5660933a8e9c4d Mon Sep 17 00:00:00 2

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread Bira
On Mon, Nov 1, 2010 at 10:32 AM, David Chelimsky wrote: > Can you post a real example of this complete with spec, > implementation, and failure message? > > Thx This is the closest I could get with my limited knowledge of RSpec's and RSpec-rails's internals. I tried to replicate a bit of rails-se

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread Bira
On Mon, Nov 1, 2010 at 10:32 AM, David Chelimsky wrote: > > Can you post a real example of this complete with spec, > implementation, and failure message? > > Thx I'm trying :)! So far it's been hard to isolate. Looks like many of the failures I get in my application actually happen "far away" f

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread David Chelimsky
On Mon, Nov 1, 2010 at 9:44 AM, Bira wrote: > On Mon, Nov 1, 2010 at 8:55 AM, Alexey Ilyichev > wrote: >> David, I got your point, however I find behavior in version 1.3.1 >> inconsistent. In my opinion, if I stub a method with a certain parameter >> value, and then call with another value, it s

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread David Chelimsky
On Mon, Nov 1, 2010 at 8:55 AM, Alexey Ilyichev wrote: > David, I got your point, however I find behavior in version 1.3.1 > inconsistent. In my opinion, if I stub a method with a certain parameter > value, and then call with another value, it should either delegate to > original method, return ni

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread Bira
On Mon, Nov 1, 2010 at 8:55 AM, Alexey Ilyichev wrote: > David, I got your point, however I find behavior in version 1.3.1 > inconsistent. In my opinion, if I stub a method with a certain parameter > value, and then call with another value, it should either delegate to > original method, return ni

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-11-01 Thread Alexey Ilyichev
David, I got your point, however I find behavior in version 1.3.1 inconsistent. In my opinion, if I stub a method with a certain parameter value, and then call with another value, it should either delegate to original method, return nil, or throw an exception. I'd be happy with either of these. But

Re: [rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-10-31 Thread dchelim...@gmail.com
On Oct 28, 7:40 am, Alexey Ilyichev wrote: > I have made 2 examples for this and I can't figure out how to make both > pass. Take a look please: > > require 'spec_helper' > > describe "Mock" do >   class A >     def self.method_missing(name, *args, &block) >       '*a_method_missing*' >     end

[rspec-users] Fwd: Issue with AR::Base descendants with certain argument

2010-10-28 Thread Alexey Ilyichev
I have made 2 examples for this and I can't figure out how to make both pass. Take a look please: require 'spec_helper' describe "Mock" do class A def self.method_missing(name, *args, &block) '*a_method_missing*' end def self.present_method(arg) '*present_method*' e