Re: [rspec-users] Rspec Tutorial

2009-10-28 Thread Lenny Marks
I loved that 'Let me google that for you' thing that I remember Dave replying with once. http://lmgtfy.com/?q=rspec+tutorial -lenny On Oct 28, 2009, at 10:35 AM, Vishu Ramanathan wrote: Lee's frustration is not groundless. In my few weeks on this list, I have noticed a lot of requests for

[rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
I've always used the idiom of stub collaborations in a before block and then focus in specific examples with should_receive. (e.g. should_receive takes presence over stub). I was just attempting to write an example for caching behavior and ran into something counter- intuitive, at least IMHO

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
Forgot to mention: rspec 1.2.9 On Dec 1, 2009, at 11:46 AM, Lenny Marks wrote: I've always used the idiom of stub collaborations in a before block and then focus in specific examples with should_receive. (e.g. should_receive takes presence over stub). I was just attempting to wri

Re: [rspec-users] should_receive(:x).at_most/exactly... ignored when method is previously stubbed?

2009-12-01 Thread Lenny Marks
On Dec 1, 2009, at 1:24 PM, Ashley Moran wrote: On Dec 01, 2009, at 4:46 pm, Lenny Marks wrote: This seems dangerous to me. Assuming I hadn't initially stubbed in the before block and everything worked as expected, if someone later stubs :lookup in the before block because the

[rspec-users] ControllerExampleGroup.bypass_rescue

2011-08-10 Thread Lenny Marks
As best I can tell, bypass_rescue from rspec-rails-1 is no longer part of rspec-rails, '> 2'. I had been using it on occasion for things like: describe CorrespondencesController do ... describe '#show' do it "should raise an AuthorizationError if current user is not the correspondent " do

Re: [rspec-users] ControllerExampleGroup.bypass_rescue

2011-08-16 Thread Lenny Marks
On Aug 11, 2011, at 8:59 AM, Justin Ko wrote: > > > On Thu, Aug 11, 2011 at 8:40 AM, David Chelimsky wrote: > On Aug 11, 2011, at 7:17 AM, Justin Ko wrote: > >> On Aug 10, 2011, at 11:13 AM, Lenny Marks wrote: >> >>> As best I can tell, bypass_rescue fro

[rspec-users] [JRuby] simulating a java exception in a spec

2011-08-22 Thread Lenny Marks
JRuby 1.6.2 rspec-core (2.6.4) rspec-expectations (2.6.0) rspec-mocks (2.6.0) rspec-rails (2.6.1) I'm sure this has more to do with the way JRuby wraps Java exceptions but I figured I'd post here in case anyone here has any insight or pointers. In the context of writing a spec for a model like t

Re: [rspec-users] [JRuby] simulating a java exception in a spec

2011-08-23 Thread Lenny Marks
> > On Aug 22, 2011, at 5:50 PM, Lenny Marks wrote: > >> JRuby 1.6.2 >> rspec-core (2.6.4) >> rspec-expectations (2.6.0) >> rspec-mocks (2.6.0) >> rspec-rails (2.6.1) >> >> I'm sure this has more to do with the way JRuby wraps Java except

[rspec-users] rspec macro style

2011-08-25 Thread Lenny Marks
One of the things that always annoys me when I write/use typical macros in my specs is how the backtrace from failures don't include the caller of the macro. Not a huge deal because the example name can be used to track it down, but I lose the ability to do things like click on the line from the

Re: [rspec-users] How to remove this deprecation warning

2011-09-01 Thread Lenny Marks
On Sep 1, 2011, at 5:03 AM, Jim Morris wrote: > Hi, > > After upgrading to rails 3.1 and rspec-rails 2.6.1 I get the following > deprecation warning, however as far as I can tell I am not defining any > examples before it is called. > > I am using the default spec_helper generated with rails

Re: [rspec-users] rspec 1.3.2, Rails 2.3.14 - plugins not loading

2011-10-21 Thread Lenny Marks
On Oct 21, 2011, at 11:05 AM, Andrew Premdas wrote: > On 21 October 2011 10:26, Matt Wynne wrote: >> >> On 18 Oct 2011, at 15:02, Jens-Christian Fischer wrote: >> >>> Hi there >>> >>> I have a weird situation. I have inherited a project in Rails 1.2.3 >>> that has been upgraded to Rails 2.3.1

Re: [rspec-users] RSpec Requestable Examples

2012-01-29 Thread Lenny Marks
On Jan 27, 2012, at 9:56 PM, Zach Dennis wrote: > I would be interested to hear any thoughts from the community about > the ability to request specific examples from a shared example group > as expressed in the rspec-requestable-examples gem. > > Here's the post that introduces them: > http://mu

Re: [rspec-users] [Newbie's Doubt] Model's Tests

2012-04-17 Thread Lenny Marks
Sorry! My posts are very delayed. On Apr 17, 2012, at 8:50 PM, Luciano Borges wrote: > I'm studying Rspec and doing some model's tests. > > I have a table with a field which must have two characters, the field should > not be empty and can not be repeated. > > My doubts is with #. > > descr

Re: [rspec-users] [Newbie's Doubt] Model's Tests

2012-04-17 Thread Lenny Marks
On Apr 17, 2012, at 8:50 PM, Luciano Borges wrote: > I'm studying Rspec and doing some model's tests. > > I have a table with a field which must have two characters, the field should > not be empty and can not be repeated. > > My doubts is with #. > > describe State do > context "validatio

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread Lenny Marks
On Aug 22, 2012, at 10:36 AM, David Chelimsky wrote: > On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: >> On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky >> wrote: >>> >>> On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger wrote: On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde w

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread Lenny Marks
On Aug 22, 2012, at 1:38 PM, Lenny Marks wrote: > > On Aug 22, 2012, at 10:36 AM, David Chelimsky wrote: > >> On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: >>> On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky >>> wrote: >>>>

[rspec-users] -l command line option broken?

2008-10-28 Thread Lenny Marks
Ooops. I meant the -l option not -n. It seems that '-l' command line option for rspec stopped working as of rspec 1.1.3. I think this may be related to why I can't get NetBeans to run focussed specs anymore. Does this work for others? I'm using jruby but I don't think that's the issue. ht

[rspec-users] -l command line option broken?

2008-10-28 Thread Lenny Marks
Sorry for not replying to the thread but I'm not getting any mail from rspec-users right now for whatever reason. It looks like it is an issue specific to jruby. With rspec-1.1.11 and jruby-1.4 #linenumber_spec.rb describe "line number" do it "should be example one" do true.should be

[rspec-users] -l command line option broken?

2008-10-28 Thread Lenny Marks
On Tue, Oct 28, 2008 at 12:31 PM, Lenny Marks wrote: > Ooops. I meant the -l option not -n. > > It seems that '-l' command line option for rspec stopped working as of > rspec 1.1.3. It's been working for me. I wrote a Vim script that runs the current spec (

Re: [rspec-users] -l command line option broken?

2008-10-29 Thread Lenny Marks
On Oct 28, 2008, at 5:46 PM, Lenny Marks wrote: I'm not familiar enough with the rspec code to get to the bottom of this, but I did enough drilling to find its related to the new backtrace based strategy for Spec::Runner::SpecParser#spec_name_for (file, line_number). Putting a

[rspec-users] -n command line option broken?

2008-10-29 Thread Lenny Marks
It seems that '-n' command line option for rspec stopped working as of rspec 1.1.3. I think this may be related to why I can't get NetBeans to run focussed specs anymore. Does this work for others? I'm using jruby but I don't think that's the issue. http://ruby.netbeans.org/issues/show_bug.

Re: [rspec-users] -l command line option broken?

2008-10-29 Thread Lenny Marks
On Oct 28, 2008, at 5:46 PM, Lenny Marks wrote: I'm not familiar enough with the rspec code to get to the bottom of this, but I did enough drilling to find its related to the new backtrace based strategy for Spec::Runner::SpecParser#spec_name_for (file, line_number). Putting a

[rspec-users] stub followed by should_receive behavior changed

2008-10-30 Thread Lenny Marks
I'm in the process of trying to get updated to rspec-1.1.11(from 1.1.1). I have a couple of places where I was trying to verify that a particular collaboration was made inside a transaction. My general strategy was to start off using something like Transaction.stub! (:execute).and_yield in a

[rspec-users] ArgumentError mystery with jruby/rspec-1.1.11

2008-12-08 Thread Lenny Marks
I just got bitten by a strange issue with rspec-1.1.11 and jruby 1.1.3-1.1.6RC1. I'd love to know what the problem was if anyone has any ideas. It's almost as if, rspec didn't like something about this particular class since substituting others worked fine. It does work with Rspec edge so I

Re: [rspec-users] New article on "Listening to Your Specs" up on Ruby Advent 2008

2008-12-16 Thread Lenny Marks
On Dec 9, 2008, at 10:40 PM, Avdi Grimm wrote: I contributed an article on BDD and RSpec to the Ruby Advent Calendar 2008, going over some of the rules I've collected for interpreting what your specs say about your design. It can be found here: http://advent2008.hackruby.com/past/2008/12/10/

Re: [rspec-users] New article on "Listening to Your Specs" up on Ruby Advent 2008

2008-12-19 Thread Lenny Marks
On Dec 16, 2008, at 3:58 PM, Ben Mabey wrote: Lenny Marks wrote: On Dec 9, 2008, at 10:40 PM, Avdi Grimm wrote: I contributed an article on BDD and RSpec to the Ruby Advent Calendar 2008, going over some of the rules I've collected for interpreting what your specs say about your d

Re: [rspec-users] New article on "Listening to Your Specs" up on Ruby Advent 2008

2008-12-19 Thread Lenny Marks
On Dec 19, 2008, at 12:55 PM, Avdi Grimm wrote: On Fri, Dec 19, 2008 at 12:02 PM, Lenny Marks wrote: Thanks to you and Dave for your responses. I've commented on the original article with back links to this thread. Hope I didn't overstep by saying "I think there is some

[rspec-users] [Cucumber] Level of features / Feature dependent steps

2009-02-17 Thread Lenny Marks
Forgive the long post, just looking for input/advice/alternate opinions.. Like many I think that going through the exercise of framing user requests in Cucumber terms(Features, Scenarios..) really helps facilitate necessary conversations and avoid time wasted implementing the wrong thing(

Re: [rspec-users] [Cucumber] Level of features / Feature dependent steps

2009-02-19 Thread Lenny Marks
e, I would use the first style. Later, I would introduce the aggregate step "Given I have paid a bill with sufficient funds" as and when I needed to. Like Jonathan said, there is still the issue of shared state, but arguments can be passed through the aggregate steps to the imperative steps

Re: [rspec-users] ArgumentError mystery with jruby/rspec-1.1.11

2009-03-10 Thread Lenny Marks
ple_group' [...]/jruby-1.2.0RC1/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/ dsl/main.rb:25:in `describe' [...] Replacing the above SecurityContextHolder definition with an import: import 'org.acegisecurity.context.SecurityContextHolder' fixed the errors. Any expla

[rspec-users] [Cucumber] Feature vs. Scenario

2009-03-19 Thread Lenny Marks
I'm curious what other people's thoughts are about when to use Features vs. Scenarios and how much it matters. I'm getting the sense that the line is a thin one, and has more to do with complexity/time to develop than anything else. I had originally enforced a fairly rigid definition of 'Sc

Re: [rspec-users] Then I should be on /users/3/posts/8/comments/2/edit

2009-04-10 Thread Lenny Marks
On Apr 10, 2009, at 12:51 AM, Ben Mabey wrote: Gavin Hughes wrote: "Then I should be on /users/3/posts/8/comments/2/edit" What's the solution for parsing out and matching and arbitrarily deep nested route? Hi Gavin, Let me try to answer your question without actually answering it. :) I gen

Re: [rspec-users] [ANN] rspec 1.2.4 Released

2009-04-15 Thread Lenny Marks
Just tried it out. Something missed? -lenny > cat t.rb describe 'test' do it "should not fail" do ['A'].should include('A') end end > spec -v rspec 1.2.4 > spec t.rb F 1) NoMethodError in 'test should not fail' undefined method `helper' for # t.rb:3: On Apr 15, 2009, at 10:18 AM,

Re: [rspec-users] [ANN] rspec 1.2.4 Released

2009-04-16 Thread Lenny Marks
On Apr 15, 2009, at 11:23 AM, Lenny Marks wrote: Just tried it out. Something missed? -lenny > cat t.rb describe 'test' do it "should not fail" do ['A'].should include('A') end end > spec -v rspec 1.2.4 > spec t.rb F 1) NoMetho

Re: [rspec-users] Cucumber - step negating another expecting step

2009-04-17 Thread Lenny Marks
I've been doing something similar. I think the benefit of having half the steps(each can be negated) wins over the small impact it has on step readability. Personally I started adding stuff like this(perhaps not as DRY but simple enough): Then /^the correspondence should (not )?have inclusi

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-04-18 Thread Lenny Marks
On Apr 18, 2009, at 1:17 PM, Fernando Perez wrote: Hi, Let's take the example of the depot app. In my controller I set @order. Then in the view comes the bad stuff: @order.items.each do |item| item.product.title end Now I'm having problems specing item.product.title. A quick and dirty fi

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly spe cing

2009-04-22 Thread Lenny Marks
On Apr 21, 2009, at 9:45 AM, Steve Schafer wrote: On Mon, 20 Apr 2009 12:40:08 -0700, you wrote: I wrote a blog post that may be helpful. http://www.patmaddox.com/blog/demeter-is-for-encapsulation Basically, when you have structural objects as in this case, demeter isn't useful. I agree

[rspec-users] Problems upgrading to Rails-2.3.2/Rspec 1.2.6

2009-06-05 Thread Lenny Marks
jruby-1.3.0 rspec/rspec-rails 1.2.6 I just ran into the 'Missing template' thing from the ticket below as well. Is it really that uncommon for a controller action to redirect or explicitly render a different template? Is it still considered 'invalid'? Seems silly to have to create a bunch o