[rspec-users] newbie first run question

2008-03-25 Thread Eric Harris-Braun
Hi folks, RSpec 1.1.3 is failing for me out of the box. I installed both rspec and rspec_on_rails using svn following the instructions on the site. Then I used the rspec generate script, created a very simple test example and run rspec with: rake spec. What I get back is: /usr/local/lib/ruby/s

[rspec-users] pending plain text story step

2008-03-25 Thread Corey Haines
#pending works when creating a step for a plain text story, but adding text to the method call doesn't spit it out in the output. Is this a bug, or are we doing something wrong? Then("blah") do pending "waiting for implementation details" end -corey -- http://www.coreyhaines.com The Internet's

Re: [rspec-users] Plaint Text Stories Comments in output?

2008-03-25 Thread Corey Haines
On Tue, Mar 25, 2008 at 2:00 PM, aslak hellesoy <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 5:56 PM, Corey Haines <[EMAIL PROTECTED]> > wrote: > > Is there an easy way to get a story output that includes comment text > inside > > the Scenario? > > > > Plain text stories are parsed and tur

[rspec-users] HOWTO: RSpec integration with Rails

2008-03-25 Thread David Nolan
Hi, I've hacked together a setup to load an RSpec backtrace into jEdit (in other words, you'll be able to click the relevant failed behaviour or error to go straight the relevant file and line). More info here: http://textgoeshere.org.uk/articles/2008/03/howto-integrate-rspec-on-rails-with-jedit/

Re: [rspec-users] Plaint Text Stories Comments in output?

2008-03-25 Thread aslak hellesoy
On Tue, Mar 25, 2008 at 5:56 PM, Corey Haines <[EMAIL PROTECTED]> wrote: > Is there an easy way to get a story output that includes comment text inside > the Scenario? > Plain text stories are parsed and turn into objects, then written out again. There is no way to capture "unknown" lines for now

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread Tim Glen
To do this, I've typically just add the HTTP_ACCEPT header. I can't remember where I picked this up, but it's does specify a format in your respond_to block: Here's the do_request (and a sample spec) for one of my specs where I'm checking for a generated csv file: def do_request @request.

[rspec-users] Plaint Text Stories Comments in output?

2008-03-25 Thread Corey Haines
Is there an easy way to get a story output that includes comment text inside the Scenario? For example, I have a scenario like Scenario: User tries to log in with invalid credentials Card: 5732 Given a visitor And username: invalid Then, be able to get a summary/output that includes

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread Matt Berther
Hi Seth, To get around this, are you able to test the response.headers collection? This tests the code that you wrote, rather than the template logic performed by rails. response.headers['Content-Type'].should == "text/html" Untested, of course... but it may work :) -- Matt Berther http://w

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread David Chelimsky
On Tue, Mar 25, 2008 at 11:38 AM, Seth Ladd <[EMAIL PROTECTED]> wrote: > > There is a guideline in TDD that you should test your code and not > > other people's code. The behaviour you're interested in testing is > > that of ActionController::Base, not of your code. > > I, of course, do not w

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread Seth Ladd
> There is a guideline in TDD that you should test your code and not > other people's code. The behaviour you're interested in testing is > that of ActionController::Base, not of your code. I, of course, do not want to test Rails. I do, however, want to ensure that I have a block to handle the

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 >> initializer interrogates the object a

Re: [rspec-users] Release date for 1.1.4?

2008-03-25 Thread Ashley Moran
On 25/03/2008, David Chelimsky <[EMAIL PROTECTED]> wrote: > > We've been talking about it for a few weeks now but have been too busy > to make it happen. Can't make a guarantee but I think it is likely > that we can get it out by the end of next week. > > Cheers, > David > Cool, thanks David.

Re: [rspec-users] [Stories]Troubles with GivenScenario

2008-03-25 Thread Bastien
done : http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/350 Thanks for your great work. On Mar 25, 1:00 pm, "David Chelimsky" <[EMAIL PROTECTED]> wrote: > On Tue, Mar 25, 2008 at 6:31 AM, Bastien <[EMAIL PROTECTED]> wrote: > > Of course, here you go : > > > steps_for(:work_area_executi

Re: [rspec-users] Release date for 1.1.4?

2008-03-25 Thread David Chelimsky
On Mar 25, 2008, at 7:37 AM, "Ashley Moran" <[EMAIL PROTECTED] > wrote: > Hi > > Does anyone have an idea when RSpec 1.1.4 will be released? We've been talking about it for a few weeks now but have been too busy to make it happen. Can't make a guarantee but I think it is likely that we can

[rspec-users] Release date for 1.1.4?

2008-03-25 Thread Ashley Moran
Hi Does anyone have an idea when RSpec 1.1.4 will be released? It has a bug fix I really want - just bought a USB-controller LED traffic light but RSpec 1.1.3 never fires the :red hook so I just get a green light constantly. (Have been pulling my hair out wondering what I was doing...) Ashley __

Re: [rspec-users] [Stories]Troubles with GivenScenario

2008-03-25 Thread David Chelimsky
On Tue, Mar 25, 2008 at 6:31 AM, Bastien <[EMAIL PROTECTED]> wrote: > Of course, here you go : > > steps_for(:work_area_execution) do > > Given("a company") do > @account = Factory.create_valid_account() > end > > Given("$amount questions?") do |amount| > Question.delete_all > ca

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread David Chelimsky
On Tue, Mar 25, 2008 at 2:06 AM, Seth Ladd <[EMAIL PROTECTED]> wrote: > Hm, of course, now that I have sent the previous email, I found the > bug in my code and have fixed it. So I know I am using RSpec > correctly with controllers and a respond_to block. Using the :format > => 'json' attribut

Re: [rspec-users] [Stories]Troubles with GivenScenario

2008-03-25 Thread Bastien
Of course, here you go : steps_for(:work_area_execution) do Given("a company") do @account = Factory.create_valid_account() end Given("$amount questions?") do |amount| Question.delete_all category = Factory.create_valid_category work_area = Factory.create_valid_work_area(ca

Re: [rspec-users] [Stories]Troubles with GivenScenario

2008-03-25 Thread David Chelimsky
On Tue, Mar 25, 2008 at 5:13 AM, Bastien <[EMAIL PROTECTED]> wrote: > I have some problems with GivenScenario, my scenario keeps on failing > when I use GivenScenario, like if the database or the session was not > in the same state at the beginning of the new scenario as it was at > the end of t

[rspec-users] [Stories]Troubles with GivenScenario

2008-03-25 Thread Bastien
I have some problems with GivenScenario, my scenario keeps on failing when I use GivenScenario, like if the database or the session was not in the same state at the beginning of the new scenario as it was at the end of the given one. If I try to group my two scenari in only one big scenario then it

Re: [rspec-users] Testing Controllers with respond_to?

2008-03-25 Thread Seth Ladd
Hm, of course, now that I have sent the previous email, I found the bug in my code and have fixed it. So I know I am using RSpec correctly with controllers and a respond_to block. Using the :format => 'json' attribute in my get call was all I needed. However, not matter what the format I choose,