Re: [rspec-users] Introductory recommendations?

2009-11-25 Thread Carl Graff
I agree that mocks are one of the harder concepts to grasp. In my case - although I will probably get some flack - I created some simple real objects first, then tried to mimic their behavior with mocks. When you are first leaning sometimes I find it better to start with a known real object th

Re: [rspec-users] Introductory recommendations?

2009-11-21 Thread Carl Graff
The RSpec Book from Pragmatic Programmers is excellent IMO. Best, Carl Andy Koch wrote: http://www.pragprog.com/titles/achbd/the-rspec-book On Nov 20, 1:11 pm, Jon Pincus wrote: Hi all, I'm with a team of engineers who are new to RSpec, and I'm looking for some good introductory materia

Re: [rspec-users] Stub that returns hash values

2009-10-21 Thread Carl Graff
Well i just started using RSpec about a week ago and mostly I was just trying to learn how to use mocks as I could have easily just created the real object in this case. Anyway, I had a real object, that needed to contain a hash of a yet to be created object, which itself contained a hash of a

Re: [rspec-users] Stub that returns hash values

2009-10-20 Thread Carl Graff
Ashley Moran wrote: On 20 Oct 2009, at 17:36, Carl Graff wrote: Is it possible to create a stub that returns hash values. For example I would like to convert this: @siteItem = stub('plmSiteItem', :one => "uno") To something like this: @siteItem = stub('plmSite

[rspec-users] Stub that returns hash values

2009-10-20 Thread Carl Graff
Is it possible to create a stub that returns hash values. For example I would like to convert this: @siteItem = stub('plmSiteItem', :one => "uno") To something like this: @siteItem = stub('plmSiteItem', {'one' => 'uno', 'two' => 'dos'} ) So that I can do this: @siteItem['one'] should ==

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Carl Graff
Alex Chaffee wrote: I often create integration programs in Ruby that utilize ActiveRecord without the full Rails stack. So I wonder what the best way would be to fully utilize Cucumber and RSpec for BDD in this context. 1. Should I still include rspec-rails so hopefully at least the Model supp

Re: [rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Carl Graff
Matt Wynne wrote: On 1 Sep 2009, at 19:44, Rick DeNatale wrote: On Tue, Sep 1, 2009 at 1:51 PM, Carl Graff wrote: Of less importance: Actually I have considered creating/converting these integration applications as full blown Rails applications since they definitely have a model and

[rspec-users] Using ActiveRecord without Rails

2009-09-01 Thread Carl Graff
Hi, I often create integration programs in Ruby that utilize ActiveRecord without the full Rails stack. So I wonder what the best way would be to fully utilize Cucumber and RSpec for BDD in this context. 1. Should I still include rspec-rails so hopefully at least the Model support is availab