Re: [rspec-users] ruby 1.8.6

2011-08-22 Thread Chuck Remes
On Aug 21, 2011, at 9:11 PM, David Chelimsky wrote: > Hey all, > > It's growing increasingly difficult for RSpec to support Ruby 1.8.6 as other > libraries that rspec's development environment relies on drop support. Noting > that 1.8.7 was released over three years ago (6/1/2008), I'd like to

Re: [rspec-users] Can you control $stdout when specs are running?

2011-01-12 Thread Chuck Remes
On Sep 30, 2010, at 10:06 AM, GregD wrote: > Hi all, > > I'm testing java classed using rspec and jruby. The java super class > is trapping an exception and sending a custom message to stdout along > with the original exception meaasage. The original exception is a > SAXParseException, if that

Re: [rspec-users] rspec-2.2 is released!

2010-12-01 Thread Chuck Remes
On Nov 29, 2010, at 9:27 AM, David Chelimsky wrote: > On Nov 29, 2010, at 8:04 AM, Chuck Remes wrote: > >> >> On Nov 28, 2010, at 4:35 PM, David Chelimsky wrote: >> >>> ### rspec-core-2.2.0 >>> >>> >>> * Performance improvments

Re: [rspec-users] rspec-2.2 is released!

2010-11-29 Thread Chuck Remes
On Nov 28, 2010, at 4:35 PM, David Chelimsky wrote: > ### rspec-core-2.2.0 > > > * Performance improvments (see > [Upgrade.markdown](https://github.com/rspec/rspec-core/blob/master/Upgrade.markdown)) Wow, the perf improvements are *much* appreciated! My test suite (MRI 1.9.2p0) with 3300 ex

Re: [rspec-users] rspec2 observations

2010-10-06 Thread Chuck Remes
On Oct 6, 2010, at 9:30 AM, David Chelimsky wrote: > On Oct 6, 2010, at 9:09 AM, Chuck Remes wrote: > >> Just a few observations now that I have completed the upgrade from RSpec-1 >> to RSpec-2. >> >> 1. In my project (2800 examples across about 40 files), MR

[rspec-users] rspec2 observations

2010-10-06 Thread Chuck Remes
Just a few observations now that I have completed the upgrade from RSpec-1 to RSpec-2. 1. In my project (2800 examples across about 40 files), MRI 1.9.2-p0 takes roughly 3 times longer to complete the spec run. Runtimes grew from 2.2s (rspec 1.3.0) to 6.1s (2.0.0.rc). 2. Rubinius 1.1.0 runs RS

Re: [rspec-users] rspec-2.0.0.rc is released

2010-10-05 Thread Chuck Remes
On Oct 4, 2010, at 11:47 PM, David Chelimsky wrote: > rspec-2.0.0.rc is released! > > See http://blog.davidchelimsky.net/2010/07/01/rspec-2-documentation/ for > links to all sorts of documentation on rspec-2. > > Plan is to release rspec-2.0.0 (final) within the next week, so please > install

Re: [rspec-users] set expectation using self in constructor?

2010-07-15 Thread Chuck Remes
On Jul 14, 2010, at 4:20 PM, Matt Wynne wrote: > > You can do this, by using a test spy to remember the value of foo passed into > the stubbed constructor and then later comparing it: > > let(:foo) { Foo.new } > > it "should allocate a helper class Foo" do > actual_foo = Bar.should_receive(:

Re: [rspec-users] set expectation using self in constructor?

2010-07-15 Thread Chuck Remes
On Jul 14, 2010, at 4:20 PM, Matt Wynne wrote: > > You can do this, by using a test spy to remember the value of foo passed into > the stubbed constructor and then later comparing it: > > let(:foo) { Foo.new } > > it "should allocate a helper class Foo" do > actual_foo = Bar.should_receive(:

[rspec-users] set expectation using self in constructor?

2010-07-14 Thread Chuck Remes
I find myself using this pattern quite a bit. rspec 1.30 ruby 1.9.1, 1.9.2-rc2, jruby 1.51 all on osx 10.6.4 class Foo def initialize @bar = Bar.new end end context "init" do it "should allocate a helper class Bar" do Bar.should_receive(:new) Foo.new end end That all works w

Re: [rspec-users] chain argument expectations?

2010-06-18 Thread Chuck Remes
On Jun 17, 2010, at 12:22 PM, David Chelimsky wrote: > On Jun 17, 2010, at 11:07 AM, Chuck Remes wrote: > >> it "should assign increasing index values to field3" do >> quxxo = mock >> Baz.stub!(:new => quxxo) >> >> quxxo.should_receive(:field2

[rspec-users] chain argument expectations?

2010-06-17 Thread Chuck Remes
I'm trying to test some code that can loop once or multiple times and assign some values to another object. I want to test one of the values being assigned to the object in the loop. e.g. class Foo def bar values = returns_an_array_of_values baz = Baz.new values.each_with_index

Re: [rspec-users] [Q] mock expectation with +self+

2009-09-09 Thread Chuck Remes
On Sep 9, 2009, at 4:37 PM, Chuck Remes wrote: I am trying to spec out a method that is using the 'beam' gem to fire an event. When the method fires the event, it should pass the current +self+ as an argument. e.g. def foo Beam.fire :my_event, self end it "should fir

[rspec-users] [Q] mock expectation with +self+

2009-09-09 Thread Chuck Remes
I am trying to spec out a method that is using the 'beam' gem to fire an event. When the method fires the event, it should pass the current +self+ as an argument. e.g. def foo Beam.fire :my_event, self end it "should fire :my_event and pass self" do Beam.should_receive(:fire).with(:my_e

Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-30 Thread Chuck Remes
On Aug 27, 2009, at 12:22 PM, Matt Wynne wrote: On 27 Aug 2009, at 17:02, Chuck Remes wrote: Let's assume that method1 and method2 are acting upon other objects that I can also mock via DI. How can I generate the 'StartEvent' so that the block above is executed? BTW, th

Re: [rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-27 Thread Chuck Remes
On Aug 27, 2009, at 10:12 AM, Matt Wynne wrote: On 26 Aug 2009, at 19:57, Chuck Remes wrote: I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_EVENT class you may subscribe to a COM event and ha

[rspec-users] [Q] testing WIN32OLE_EVENT callbacks

2009-08-26 Thread Chuck Remes
I'm trying to setup some specs (really just assertions) that verify some callbacks are executed in response to COM events. In the WIN32OLE_EVENT class you may subscribe to a COM event and have it delivered to you for processing. Syntax looks like: event_handler.on_event('Start

Re: [rspec-users] arbitrary handling of received messages in mocks

2009-08-26 Thread Chuck Remes
On Aug 25, 2009, at 5:13 PM, Tom Stuart wrote: 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/

[rspec-users] arbitrary handling of received messages in mocks

2009-08-25 Thread Chuck Remes
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

Re: [rspec-users] How to unit test code that connects to the external resources?

2008-09-08 Thread Chuck Remes
On Sep 8, 2008, at 12:12 PM, Yi Wen wrote: By external resources, I mean, the code start a http connection and GET xmls from the url specified. I will definitely not rely my unit test on an external url or anything like that. But how do I unit test the method? I mean, I can basically mock

Re: [rspec-users] spec'ing the existence of #require

2008-08-31 Thread Chuck Remes
On Aug 31, 2008, at 2:58 PM, David Chelimsky wrote: On Sun, Aug 31, 2008 at 2:38 PM, Chuck Remes <[EMAIL PROTECTED]> wrote: On Aug 31, 2008, at 12:42 PM, Scott Taylor wrote: On Aug 31, 2008, at 10:36 AM, Chuck Remes wrote: I looked through the mailing list archive but unfortunat

Re: [rspec-users] spec'ing the existence of #require

2008-08-31 Thread Chuck Remes
On Aug 31, 2008, at 12:42 PM, Scott Taylor wrote: On Aug 31, 2008, at 10:36 AM, Chuck Remes wrote: I looked through the mailing list archive but unfortunately my search terms are too generic (spec and require...). I am writing ruby code that runs under jruby in an embedded environment

[rspec-users] spec'ing the existence of #require

2008-08-31 Thread Chuck Remes
I looked through the mailing list archive but unfortunately my search terms are too generic (spec and require...). I am writing ruby code that runs under jruby in an embedded environment. Periodically I will install new code that passes all specs only to have it fail when it can't find a ne

Re: [rspec-users] How much test data to use in specs

2008-08-27 Thread Chuck Remes
We'd recommend that you start sending our your resumé. :) cr On Aug 27, 2008, at 1:55 PM, Jonathan Linowes wrote: what if my office were at Route 102 & Yahoo! Way, Suite #123 :) On Aug 27, 2008, at 2:03 PM, Nick Hoffman wrote: On 2008-08-27, at 12:57, Rahoul Baruah wrote: For th

[rspec-users] [bug] mock expectations fail when a subclass is instantiated

2008-08-16 Thread Chuck Remes
I took a look at the web site but did not see any issue/bug tracker, so I'm reporting this here. The mock framework fails to differentiate between messages sent to a parent class versus a subclass, so some of my expectations fail when I assert some expectation on a parent. Here's code to sh

[rspec-users] test - ignore

2008-06-13 Thread Chuck Remes
Verify I can successfully send to the list. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] help with test design

2008-06-11 Thread Chuck Remes
I'm having trouble figuring out how to drive the design of a class. I'm hoping I can get a hint or two from the more experienced BDDers on this list. I'm writing an adapter class that sits between a 3rd party library and my business logic. I would like to extract some information from obj

Re: [rspec-users] Given .. and .. - And requires capitalisation

2008-03-31 Thread Chuck Remes
On Mar 31, 2008, at 4:53 PM, Tim Haines wrote: > Hi Guys, > > Just writing out a plain English story and was surprised to see one > of my steps wasn't listed as pending. It turned out it was because > I had started the line with and instead of And. Is there any reason > why and shouldn't

Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
On Mar 28, 2008, at 1:46 PM, David Chelimsky wrote: > On Fri, Mar 28, 2008 at 1:38 PM, Chuck Remes > <[EMAIL PROTECTED]> wrote: >> I'm trying to use a mock to return a hash so that #each_pair can >> process it. I can't get it to work. Whatever I return to #ea

Re: [rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
, Mar 28, 2008 at 1:38 PM, Chuck Remes > <[EMAIL PROTECTED]> wrote: >> I'm trying to use a mock to return a hash so that #each_pair can >> process it. I can't get it to work. Whatever I return to #each_pair >> is >> ignored and the block never gets ex

[rspec-users] [Q] bug in mocks or user error?

2008-03-28 Thread Chuck Remes
I'm trying to use a mock to return a hash so that #each_pair can process it. I can't get it to work. Whatever I return to #each_pair is ignored and the block never gets executed. Here's an example illustrating the problem. require File.join(File.dirname(__FILE__), %w[spec_helper]) class MyE

Re: [rspec-users] Trouble with my first Story

2008-03-26 Thread Chuck Remes
On Mar 26, 2008, at 4:02 PM, Glenn Ford wrote: > Hi all! I've been through the RSpec Stories PeepCode and some various > other readings online, and now I'm trying to build a dummy application > of the traditional style: log in, make posts, add comments. > > So I've run the scaffold for posts/comm

Re: [rspec-users] [Q] how do I test the behavior of a Builder pattern object?

2008-03-25 Thread Chuck Remes
On Mar 25, 2008, at 12:04 AM, Pat Maddox wrote: > On Mon, Mar 24, 2008 at 6:50 PM, Chuck Remes > <[EMAIL PROTECTED]> wrote: >> So I have a complex object that I need to construct. This complex >> object, at runtime, takes an object in its initializer. The >> initi

Re: [rspec-users] [Q] how do I test the behavior of a Builder pattern object?

2008-03-24 Thread Chuck Remes
On Mar 24, 2008, at 8:50 PM, Chuck Remes wrote: > [snip code] > > How the heck do I test anything here? I do not see how I can validate > the behavior of #create_foo or #create_bar without exposing > @complex_object via a public interface. Those #create_* methods are > purel

[rspec-users] [Q] how do I test the behavior of a Builder pattern object?

2008-03-24 Thread Chuck Remes
So I have a complex object that I need to construct. This complex object, at runtime, takes an object in its initializer. The initializer interrogates the object and creates several collaborative objects based upon values from that interrogation. The construction is complicated enough that i

Re: [rspec-users] What is your workflow? Or how to use the story runner the right way.

2008-03-22 Thread Chuck Remes
On Mar 4, 2008, at 7:43 AM, Chris Parsons wrote: > [snip details about story & spec workflow] > > Sound like a lot of work, but given practice you can zip through these > steps very quickly. You also get a free 'focusing tool' (lose sight of > where you are? just run the story test and write more

Re: [rspec-users] for a beginner - good rspec examples?

2008-03-11 Thread Chuck Remes
On Mar 11, 2008, at 8:52 AM, Daniel Kehoe wrote: > I'm learning to use rspec and I want to see some good examples. > > Any recommendations of open source projects that demonstrate the use > of rspec? > > So far I've found: > > 1) the Caboose sample app (http://sample.caboo.se/) > > 2) the Alt

Re: [rspec-users] [Q] how to restructure tests for an abstract class?

2008-02-26 Thread Chuck Remes
On Feb 25, 2008, at 8:30 AM, David Chelimsky wrote: > On Mon, Feb 25, 2008 at 6:23 AM, Chuck Remes > <[EMAIL PROTECTED]> wrote: >> Thanks for asking this question. This is exactly what I was going >> to write, >> but you beat me to it! >> >> (Sorry

Re: [rspec-users] [Q] how to restructure tests for an abstract class?

2008-02-25 Thread Chuck Remes
include a certain module (through shared behaviour for example), or would you use one set of specs for just the module, and specify that a class should include that module? On Sun, Feb 24, 2008 at 12:19 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: On Thu, Feb 21, 2008 at 8:09 AM, Chuck

[rspec-users] [Q] how to restructure tests for an abstract class?

2008-02-21 Thread Chuck Remes
While practicing BDD on my first-ever BDD project, I have come to a point where it makes sense to change my original class to an abstract class and create one (or more) concrete subclasses that implement a specific method. What is the right way to restructure the tests in this scenario? Do

[rspec-users] newbie - am I on the right track?

2008-02-20 Thread Chuck Remes
A few days ago I posted a message asking for help in pointing out examples of rspec in the wild. I took the input from that thread, looked through specs from random projects on rubyforge, and pored over the docs. I decided to make my first project a rewrite of a Protocol for EventMachine [1

Re: [rspec-users] need to learn by example

2008-02-15 Thread Chuck Remes
On Feb 15, 2008, at 8:14 AM, Kiran1009 wrote: > > Hi, > > This is most USEFUL... > > http://www.oreillynet.com/pub/a/ruby/2007/08/09/behavior-driven-development-using-ruby-part-1.html > > Check this out... Excellent pointer!! Thank you. I'll see if this series of articles can be added to an rs

[rspec-users] need to learn by example

2008-02-13 Thread Chuck Remes
I'm starting a new project which I would like to use as a learning opportunity for BDD. I've searched through the archives of this list for past pointers on web sites and books to peruse but I haven't found very many suggestions on good projects "in the wild" which put BDD on display. I'm