Re: [rspec-users] default to just call the method?

2010-01-18 Thread David Chelimsky
On Mon, Jan 18, 2010 at 2:33 PM, Pat Maddox wrote: > On Jan 18, 2010, at 7:12 AM, David Chelimsky wrote: > >> On Mon, Jan 18, 2010 at 9:03 AM, Ashley Moran >> wrote: >>> >>> On Jan 18, 2010, at 9:31 am, Pat Maddox wrote: >>> define_simple_predicate_matcher :rise_from_the_ashes? >>> >>> As an

Re: [rspec-users] default to just call the method?

2010-01-18 Thread Pat Maddox
On Jan 18, 2010, at 7:12 AM, David Chelimsky wrote: > On Mon, Jan 18, 2010 at 9:03 AM, Ashley Moran > wrote: >> >> On Jan 18, 2010, at 9:31 am, Pat Maddox wrote: >> >>> define_simple_predicate_matcher :rise_from_the_ashes? >> >> As an extension, how about: >> >> define_simple_predicate_matche

Re: [rspec-users] testing named_scope

2010-01-18 Thread Craig Demyanovich
On Mon, Jan 18, 2010 at 5:17 AM, David Chelimsky wrote: > On Mon, Jan 18, 2010 at 4:01 AM, Pat Maddox > wrote: > ... > > class User < ActiveRecord::Base > > named_scope :admins, :conditions => {:admin => true} > > end > > > > describe User, "admins" do > > it "should include users with admin

Re: [rspec-users] default to just call the method?

2010-01-18 Thread Ashley Moran
On Jan 18, 2010, at 3:12 pm, David Chelimsky wrote: > I'd rather not add a new DSL for the few cases in which we want to > essentially delegate a predicate. We can already do this with the > matcher DSL: I think Pat was just suggesting Roger try this in his own code. It's not something I espec

Re: [rspec-users] Something like tags in cucumber

2010-01-18 Thread Phillip Koebbe
David Chelimsky wrote: On Mon, Jan 18, 2010 at 9:06 AM, Phillip Koebbe wrote: In cucumber, I use tags in a very simple, yet helpful (to me) way: to number my scenarios. For example: @1 Scenario: This is a scenario @2 Scenario: This is another scenario @3 Scenario: You get the idea

Re: [rspec-users] Something like tags in cucumber

2010-01-18 Thread David Chelimsky
On Mon, Jan 18, 2010 at 9:06 AM, Phillip Koebbe wrote: > In cucumber, I use tags in a very simple, yet helpful (to me) way: to number > my scenarios. For example: > > @1 > > Scenario: This is a scenario > > @2 > > Scenario: This is another scenario > > @3 > > Scenario: You get the idea > > This al

Re: [rspec-users] default to just call the method?

2010-01-18 Thread David Chelimsky
On Mon, Jan 18, 2010 at 9:03 AM, Ashley Moran wrote: > > On Jan 18, 2010, at 9:31 am, Pat Maddox wrote: > >> define_simple_predicate_matcher :rise_from_the_ashes? > > As an extension, how about: > > define_simple_predicate_matcher :risen_from_the_ashes => > :rises_from_the_ashes? I'd rather not

[rspec-users] Something like tags in cucumber

2010-01-18 Thread Phillip Koebbe
In cucumber, I use tags in a very simple, yet helpful (to me) way: to number my scenarios. For example: @1 Scenario: This is a scenario @2 Scenario: This is another scenario @3 Scenario: You get the idea This allows me to focus in on a single scenario quite easily while I'm working on it.

Re: [rspec-users] default to just call the method?

2010-01-18 Thread Ashley Moran
On Jan 18, 2010, at 9:31 am, Pat Maddox wrote: > define_simple_predicate_matcher :rise_from_the_ashes? As an extension, how about: define_simple_predicate_matcher :risen_from_the_ashes => :rise_from_the_ashes? Also, in general, I think specs look better without ? symbols on methods, my prefer

Re: [rspec-users] testing named_scope

2010-01-18 Thread David Chelimsky
On Mon, Jan 18, 2010 at 4:01 AM, Pat Maddox wrote: > On Jan 17, 2010, at 6:17 PM, Nin wrote: > > Hi! I'm new to rspec and was wondering how named_scopes are usually > > tested? Is it enough to test that it's defined? or do you need to test > > the behavior as well? I've been reading around and thi

Re: [rspec-users] testing named_scope

2010-01-18 Thread Pat Maddox
class User < ActiveRecord::Base named_scope :admins, :conditions => {:admin => true} end describe User, "admins" do it "should include users with admin flag" do admin = User.create! :admin => true User.admin.should include(admin) end it "should not include users without admin flag

Re: [rspec-users] default to just call the method?

2010-01-18 Thread Pat Maddox
On Jan 15, 2010, at 6:19 AM, Ashley Moran wrote: > > On 14 Jan 2010, at 17:02, Rick DeNatale wrote: > >> -1 >> >> You can already say >> >> a.should include("1:4") >> >> which is clearer IMHO. > > > I assume Roger was referring to the general case though (which I still don't > like) - and