Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-19 Thread Aslak Hellesøy
On Aug 19, 2008, at 6:28 AM, Jim Morris wrote: aslak hellesoy wrote: I'm inviting you to provide some constructive feedback about how we could improve it to make the transition easier for people like yourself. I'll give it a try, I'll port some of my stories to cucumber and see how it

[rspec-users] Parameters and View Specs

2008-08-19 Thread Matt Wynne
Sigh. Sorry to ask such a dumb question, but I've hit one of those walls... I'm testing a view which uses the params[] hash directly. (Aside: is this bad form?) How the heckers do I set up the params hash in my test? I've tried calling render 'some/view', { :first_param = true }

Re: [rspec-users] Parameters and View Specs

2008-08-19 Thread David Chelimsky
On Tue, Aug 19, 2008 at 6:18 AM, Matt Wynne [EMAIL PROTECTED] wrote: Sigh. Sorry to ask such a dumb question, but I've hit one of those walls... I'm testing a view which uses the params[] hash directly. (Aside: is this bad form?) How the heckers do I set up the params hash in my test? I've

Re: [rspec-users] command line options in story runner run method

2008-08-19 Thread aidy lewis
Hi David, 2008/8/18 David Chelimsky [EMAIL PROTECTED]: Those options don't make it to the runner, which reads the actual command line (ARGV). What I typically do is load up runner files that look like this: # stories/accounting/stories.rb with_steps_for :accounting do run

[rspec-users] When to mock

2008-08-19 Thread Jonathan Kinney
I noticed that the examples on the rspec website for model code http://rspec.info/documentation/rails/writing/models.html have no mocks or stubs. However both the controller example and view example do have mocks and stubs implemented. I was having some problems getting mocks to work in my model

Re: [rspec-users] When to mock

2008-08-19 Thread Scott Taylor
On Aug 19, 2008, at 9:38 AM, Jonathan Kinney wrote: I noticed that the examples on the rspec website for model code http://rspec.info/documentation/rails/writing/models.html have no mocks or stubs. However both the controller example and view example do have mocks and stubs implemented. I

Re: [rspec-users] When to mock

2008-08-19 Thread Matt Wynne
It's also, for me, nice to isolate the code I'm testing using mocks. So if I'm building a controller and I mock out the behaviour I will expect it to call on the model layer, I know that any failing tests must be due to bugs in the controller class, nowhere else. Coming from using an

Re: [rspec-users] When to mock

2008-08-19 Thread Mark Wilden
On Tue, Aug 19, 2008 at 7:08 AM, Scott Taylor [EMAIL PROTECTED] wrote: Ultimately, it's all about convenience and your comfort level. The reason mocking is as popular as it is is simply because of slow test suites (google Dan Manges and unitrecord, if you are curious). Another reason why

[rspec-users] rake spec loads development environment

2008-08-19 Thread Satish Gunnu
Hi, I am new to rspec and started implementing it on my project yesterday. I have followed the instructions and installed rspec gem and rspec plugin into my project. I created couple of sample stories and tried running the specs using spec command which worked fine, but when I started using

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Satish Gunnu
Hi David, Most of my knowledge came from peepcode rspec screencast and the following link. http://rspec.rubyforge.org/documentation/rails/install.html Here are the steps I have done to get going. 1) Installed rspec gem 2) Installed rspec plugin in my project 3) created a test_spec.rb

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Jonathan Linowes
On Aug 19, 2008, at 2:05 PM, Satish Gunnu wrote: Hi, I am new to rspec and started implementing it on my project yesterday. I have followed the instructions and installed rspec gem and rspec plugin into my project. I created couple of sample stories and tried running the specs using spec

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Satish Gunnu
Yes I think that is what's happening in my case. is this how it is supposed to work? or can we have rspec ignore the step to look at development environment. thanks so much for all your help. iirc, it looks at the development environment to prepare the db schema, but still runs the specs in

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Mark Wilden
On Tue, Aug 19, 2008 at 2:08 PM, Jonathan Linowes [EMAIL PROTECTED]wrote: you'll notice that vendor/plugins/rspec-rails/rspec.rake contains the line spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? db:test:prepare : :noop which you could change or comment out

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread David Chelimsky
On Tue, Aug 19, 2008 at 3:08 PM, Satish Gunnu [EMAIL PROTECTED] wrote: Hi David, Most of my knowledge came from peepcode rspec screencast and the following link. http://rspec.rubyforge.org/documentation/rails/install.html Here are the steps I have done to get going. 1) Installed rspec

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Mark Wilden
http://rspec.rubyforge.org/documentation/rails/install.html I sure wish someone would take that page down - it's caused me more than my share of grief. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Satish Gunnu
Awesome. Thanks guys. Appreciate your help. Mark Wilden wrote: On Tue, Aug 19, 2008 at 2:08 PM, Jonathan Linowes [EMAIL PROTECTED]wrote: you'll notice that vendor/plugins/rspec-rails/rspec.rake contains the line spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml'))

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread David Chelimsky
Done On Tue, Aug 19, 2008 at 4:09 PM, Mark Wilden [EMAIL PROTECTED] wrote: http://rspec.rubyforge.org/documentation/rails/install.html I sure wish someone would take that page down - it's caused me more than my share of grief. ///ark ___

Re: [rspec-users] rake spec loads development environment

2008-08-19 Thread Jonathan Linowes
On Aug 19, 2008, at 5:08 PM, Jonathan Linowes wrote: On Aug 19, 2008, at 4:32 PM, Satish Gunnu wrote: Yes I think that is what's happening in my case. is this how it is supposed to work? or can we have rspec ignore the step to look at development environment. thanks so much for all your

[rspec-users] failing before :all doesn't move progress bar in html reports

2008-08-19 Thread juuuser
Hello. I've found one bug when failing before :all block doesn't move html report's progress bar correctly. You can test it out easily by doing something like this: describe bad bad bad do before :all do true.should be_false end it empty do end end Now run this spec with html formatter and

Re: [rspec-users] failing before :all doesn't move progress bar in html reports

2008-08-19 Thread Maurício Linhares
Maybe you shouldn't be placing spectations in a before or after filter, it doesn't make much sense. On Tue, Aug 19, 2008 at 6:53 PM, juuuser [EMAIL PROTECTED] wrote: Hello. I've found one bug when failing before :all block doesn't move html report's progress bar correctly. You can test

Re: [rspec-users] failing before :all doesn't move progress bar in html reports

2008-08-19 Thread juuuser
It makes sense to me. Let's say that you want to initialize object in your before :all, but this fails. For example, in my case I'm using RSpec for automated web testing with Watir and I'm logging into web application from before :all and if this fails then it's logical that there's no point to

Re: [rspec-users] failing before :all doesn't move progress bar in html reports

2008-08-19 Thread Pat Maddox
On Tue, Aug 19, 2008 at 5:55 PM, Maurício Linhares [EMAIL PROTECTED] wrote: Maybe you shouldn't be placing spectations in a before or after filter, it doesn't make much sense. I disagree. They can be useful for verifying assumptions about fixture data. At any rate, a bug's a bug. juuser: can

Re: [rspec-users] Any news on the rSpec books?

2008-08-19 Thread Pat Maddox
On Fri, Aug 15, 2008 at 11:29 AM, Dan North [EMAIL PROTECTED] wrote: There are also some success stories around using rspec story runner + jruby as a functional testing layer for Java apps. Someone blogged about it a while ago but I forget who.

[rspec-users] RSpec raising routing errors where Rails doesn't?

2008-08-19 Thread RSL ___
Hopefully someone here can help me figure out why the ERB: % form_for(@fund, :url = {:host = PRIVATE_HOST}, :html = {:class = 'fund', :multipart = true}) do |f| % raises an error in my specs: No route matches {:action=index} but works fine in my app and generates the following, desired

Re: [rspec-users] Stubbing calls to the command line

2008-08-19 Thread Pat Maddox
On Thu, Aug 14, 2008 at 5:09 PM, Zach Dennis [EMAIL PROTECTED] wrote: I might end up with a separate object which managed making the wget system call, and then I've have an integration-style test which ensured it correctly downloaded a given passed in URL. +1

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-19 Thread Pat Maddox
What do you think is the best thing to do? I would prefer to merge it into RSpec whenever it's ready. One of the strong points about RSpec is that it's a complete BDD toolkit: example framework for developer testing, feature runner for customer test, and the mock objects framework. People can

Re: [rspec-users] RSpec raising routing errors where Rails doesn't?

2008-08-19 Thread David Chelimsky
On Tue, Aug 19, 2008 at 5:17 PM, RSL ___ [EMAIL PROTECTED] wrote: Hopefully someone here can help me figure out why the ERB: % form_for(@fund, :url = {:host = PRIVATE_HOST}, :html = {:class = 'fund', :multipart = true}) do |f| % raises an error in my specs: No route matches

[rspec-users] I want RSpec for CSS layout.

2008-08-19 Thread Jay Levitt
I don't even know how it'd be possible (through Selenium?), but I want it. I want to see if my stupid CSS hacks break. I want to say: describe #nav-column do body = something(#body-column) it should line up at the top do dom[:top].should_be == body.dom[:top] end it should always

Re: [rspec-users] Documentation for Plain-Text Stories

2008-08-19 Thread Jim Morris
Aslak Hellesøy wrote: Right now the scope of Before/After is global - i.e. all Before and After blocks will run before and after each scenario. I have deliberately postponed adding scoping of this until I better understand how people want to define this scoping. Here is one ideas: class