Re: [rspec-users] gem generators on 1.2.6

2008-10-07 Thread Pat Maddox
On Tue, Oct 7, 2008 at 4:34 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Oct 7, 2008 at 4:58 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: >>> I've confirmed that with a fresh rails (2.x) app it works fine. Is >>> this supposed to work with 1.2.6? Are there any workarounds that >>> people

Re: [rspec-users] Testing Generators

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 5:24 PM, Pau Cor <[EMAIL PROTECTED]> wrote: > Scott Taylor wrote: >> Why don't you generate the specs when you generate the code? > > That's what I thought I'd have to do. The reason I'm reluctant to do it > is that either I need to write the real code first (and not tests >

Re: [rspec-users] gem generators on 1.2.6

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 4:58 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: >> I've confirmed that with a fresh rails (2.x) app it works fine. Is >> this supposed to work with 1.2.6? Are there any workarounds that >> people have? Is my app just fucked atm? > > erm, I've also confirmed that with a fres

Re: [rspec-users] expected redirect to "/admin/account", got redirect to "/admin/account" ...

2008-10-07 Thread Scott Taylor
On Oct 7, 2008, at 7:04 PM, Pat Maddox wrote: Getting the failure message: expected redirect to "/admin/account", got redirect to "/admin/ account" I'm on Rails 1.2.6 with edge rspec/rspec-rails. There's nothing funky inside that I can tell, but this is my first day with the app. I assume

[rspec-users] expected redirect to "/admin/account", got redirect to "/admin/account" ...

2008-10-07 Thread Pat Maddox
Getting the failure message: expected redirect to "/admin/account", got redirect to "/admin/account" I'm on Rails 1.2.6 with edge rspec/rspec-rails. There's nothing funky inside that I can tell, but this is my first day with the app. I assume this has to do with the fact that it's old ass rails.

Re: [rspec-users] Testing Generators

2008-10-07 Thread Pau Cor
Scott Taylor wrote: > Why don't you generate the specs when you generate the code? That's what I thought I'd have to do. The reason I'm reluctant to do it is that either I need to write the real code first (and not tests first). Or I need to rerun my generator every time I write a new test (or

Re: [rspec-users] gem generators on 1.2.6

2008-10-07 Thread Ben Mabey
Pat Maddox wrote: In a 1.2.6 app (don't ask), I don't see the generators available to me with the gems installed. However the documentation makes it look like it should work: Generator gems are also available: 1. gem search -r generator 2. gem install login_generator 3. ./script/generate l

Re: [rspec-users] gem generators on 1.2.6

2008-10-07 Thread Pat Maddox
> I've confirmed that with a fresh rails (2.x) app it works fine. Is > this supposed to work with 1.2.6? Are there any workarounds that > people have? Is my app just fucked atm? erm, I've also confirmed that with a fresh rails 1.2.6 app it DOESN'T see the gem generators. I'm pretty suspicious

[rspec-users] gem generators on 1.2.6

2008-10-07 Thread Pat Maddox
In a 1.2.6 app (don't ask), I don't see the generators available to me with the gems installed. However the documentation makes it look like it should work: Generator gems are also available: 1. gem search -r generator 2. gem install login_generator 3. ./script/generate login I've confirmed

Re: [rspec-users] post authentication token

2008-10-07 Thread Mark Thomson
Nice. Thanks. I had wondered if there was a way to separate the data initialization from the step definitions. Looks like that's what this does. Zach Dennis wrote: You may want to look into using seed data. I currently use seed_fu by mbleigh: http://github.com/mbleigh/seed-fu/tree/master H

Re: [rspec-users] post authentication token

2008-10-07 Thread Zach Dennis
You may want to look into using seed data. I currently use seed_fu by mbleigh: http://github.com/mbleigh/seed-fu/tree/master Here's the snippet I use to load them: ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test']) ActiveRecord::Schema.verbose = false lo

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread aslak hellesoy
On Tue, Oct 7, 2008 at 7:14 PM, aidy lewis <[EMAIL PROTECTED]> wrote: > Guys. > On 07/10/2008, aidy lewis <[EMAIL PROTECTED]> wrote: > >> Thanks for your response. >> >> That doesn't seem to report for me (maybe it is because one of my >> tests fails - throws an exception and then writes to the c

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread aslak hellesoy
On Tue, Oct 7, 2008 at 6:39 PM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > Is there anyway I can cycle through all the features in a folder and > pipe to html > through the command line? > > For this: > C:\SvnProjects\my_application\features> cucumber *.feature --format html > > my_applicatio

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread aidy lewis
Guys. On 07/10/2008, aidy lewis <[EMAIL PROTECTED]> wrote: > Thanks for your response. > > That doesn't seem to report for me (maybe it is because one of my > tests fails - throws an exception and then writes to the console > before it outputs to the html file). > Sorry for being a balloon. H

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread aidy lewis
Hi David, > cucumber folder_name --format html > report.html Thanks for your response. That doesn't seem to report for me (maybe it is because one of my tests fails - throws an exception and then writes to the console before it outputs to the html file). Cheers Aidy _

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread aslak hellesoy
On Tue, Oct 7, 2008 at 6:47 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Tue, Oct 7, 2008 at 11:39 AM, aidy lewis <[EMAIL PROTECTED]> wrote: >> Hi, >> >> Is there anyway I can cycle through all the features in a folder and >> pipe to html >> through the command line? >> >> For this: >> C:\Sv

Re: [rspec-users] cucumber and html reports

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 11:39 AM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > Is there anyway I can cycle through all the features in a folder and > pipe to html > through the command line? > > For this: > C:\SvnProjects\my_application\features> cucumber *.feature --format html > > my_applicati

[rspec-users] cucumber and html reports

2008-10-07 Thread aidy lewis
Hi, Is there anyway I can cycle through all the features in a folder and pipe to html through the command line? For this: C:\SvnProjects\my_application\features> cucumber *.feature --format html > my_application.htm I am getting a wrong number of arguments (3 for 1). Or how could run all featu

Re: [rspec-users] Expectation ordering

2008-10-07 Thread Ashley Moran
On 7 Oct 2008, at 15:55, David Chelimsky wrote: Is the block no longer being executed? If so, then we have a problem :) Please report this at http://rspec.lighthouseapp.com. Bizarrely, my little test... require 'spec' describe "Blocks" do it "should be called" do b = mock(Obje

Re: [rspec-users] can I get more details in the "rake spec" output (e.g. for eql fail, what was the actual value that was returned)???

2008-10-07 Thread Nick Hoffman
On 2008-10-07, at 00:25, Greg Hauptmann wrote: 'Recurring.add projections (perform credit card payment) should calculate amount based on offset provided' FAILED expected no Exception, got #exception> ==> Actually does show exception name, but doesn't give a back trace? Is there a way to see t

Re: [rspec-users] post authentication token

2008-10-07 Thread Mark Thomson
Hey thanks Zach. That was a good suggestion. What the log file showed me was that I had a nil object being accessed in my "new" action - and the reason is that it's an object that in my development code is read from a table of global variables in my db. I create that table, including the values

Re: [rspec-users] Expectation ordering

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 9:40 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 7 Oct 2008, at 15:15, David Chelimsky wrote: > >> As far as I know this form of expectation ordering was never >> supported. If you've seen documentation that suggests it should be, >> please point me to it so I can reso

Re: [rspec-users] Specifying a specific error is re-raised

2008-10-07 Thread Ashley Moran
On 7 Oct 2008, at 15:33, David Chelimsky wrote: Regardless, if you really care about the specific instance you can do this: lambda { @connection.receive_data("UPDATE\n") }.should raise_error {|error| error.should equal(@error)} If what you care about is the message, you can expect specific

Re: [rspec-users] Expectation ordering

2008-10-07 Thread Ashley Moran
On 7 Oct 2008, at 15:15, David Chelimsky wrote: As far as I know this form of expectation ordering was never supported. If you've seen documentation that suggests it should be, please point me to it so I can resolve the discrepancy. Aslak told me himself... on this list :o) Ordering in rsp

Re: [rspec-users] Specifying a specific error is re-raised

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 8:57 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > I've got code I want to intercept all errors (to report them) but re-raise > them immediately. Currently the raise_error matcher doesn't support > matching against instances of exception classes, so I've done this to

Re: [rspec-users] Testing Generators

2008-10-07 Thread Scott Taylor
On Oct 7, 2008, at 6:02 AM, Pau Cor wrote: Hi, I have started writing my own generators, and I was wondering if anyone had any suggestions for testing them. I know I could just run the generator in a dummy application; write my tests; and then copy the tests back into the generator. But th

Re: [rspec-users] Expectation ordering

2008-10-07 Thread David Chelimsky
On Tue, Oct 7, 2008 at 7:59 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > Can I still rely on this RSpec behaviour? > > I've got a spec for a TCP socket client: > > it "should do things in a sane order" do >@socket.should_receive(:write) do > @socket.should_receive(:rea

[rspec-users] Specifying a specific error is re-raised

2008-10-07 Thread Ashley Moran
Hi I've got code I want to intercept all errors (to report them) but re- raise them immediately. Currently the raise_error matcher doesn't support matching against instances of exception classes, so I've done this to prove that the actual exception was re-raised: describe "when th

Re: [rspec-users] post authentication token

2008-10-07 Thread Matt Wynne
Another tip is to use script/console and walk the app manually. In script/console you get an app object which is the context that your story steps / integration tests run in. e.g. $script/console Loading rails blah blah blah >> app.post "/login", :username => "matt", :password => "secret" >>

[rspec-users] Expectation ordering

2008-10-07 Thread Ashley Moran
Hi Can I still rely on this RSpec behaviour? I've got a spec for a TCP socket client: it "should do things in a sane order" do @socket.should_receive(:write) do @socket.should_receive(:read) do @socket.should_receive(:close) end end

Re: [rspec-users] post authentication token

2008-10-07 Thread Zach Dennis
On Tue, Oct 7, 2008 at 8:36 AM, Mark Thomson <[EMAIL PROTECTED]> wrote: > Hmm, thanks. Still not sure if I'm diagnosing my problem correctly. Just to > be clear, I don't have any user authentication going on, just a regular > Rails button_to call. I tried installing webrat and put "visits '/' " in

Re: [rspec-users] post authentication token

2008-10-07 Thread Mark Thomson
Hmm, thanks. Still not sure if I'm diagnosing my problem correctly. Just to be clear, I don't have any user authentication going on, just a regular Rails button_to call. I tried installing webrat and put "visits '/' " in my "given" step and "clicks_button" in my "when" step. However I get an er

[rspec-users] Testing Generators

2008-10-07 Thread Pau Cor
Hi, I have started writing my own generators, and I was wondering if anyone had any suggestions for testing them. I know I could just run the generator in a dummy application; write my tests; and then copy the tests back into the generator. But that seems backwards. Any ideas? Thanks -- Posted

Re: [rspec-users] post authentication token

2008-10-07 Thread Matt Wynne
This is actually a pretty tough problem for a newbie, and sent me reeling away from the story runner with my gumption in tatters the first time I tried it. You could probably figure out how to post an authentication token in the HTTP headers if you use the basic underlying rails integration