[rspec-users] Running Rspec from ruby code

2008-12-03 Thread Attila Juhász
Hi everyone! First of all I am quite new at the rspec world. I have an idea, but I can't make it work. I would like to run one rspec spec file from a ruby daemon, and get the result back into a string. Is it possible to manage this task? Could you give me some direction? Many thanks, Attila ---

[rspec-users] I met a trouble: cannot do a form post to an outside website

2008-12-03 Thread Newman Huang
now i use webrat for cucumber scenario testing. i have a page with a form, which will post to a bank payment gateway. that is, http://www.abank.com/pay/blablabla";> ... my scenario step script is: == And I press "confirm" == then I got such an error: "No route matches "/pay/blablabla"

Re: [rspec-users] Sample App - TDD with Cucumber and RSpec

2008-12-03 Thread Ashley Moran
On 2 Dec 2008, at 19:25, Pat Maddox wrote: Given ... Postie.count.should == 0 end It's just an assertion (in the C sense of the word, not testing). You should be starting off with a clean slate anyway...but having a couple assertions before you run can be very helpful for localization. Plus

Re: [rspec-users] class << self considered harmful... really?

2008-12-03 Thread Matt Wynne
On 2 Dec 2008, at 22:31, Mark Wilden wrote: Here's what The Ruby Programming Language says about this: "In general, it is clearer to define class methods as individual singleton methods without explicitly opening the eigenclass" (p. 258) This is far from a blanket condemnation, and, as wit

[rspec-users] Indentation Conventions for Ruby and Cucumber

2008-12-03 Thread Mikel Lindsaar
On Thu, Nov 27, 2008 at 4:28 PM, Aslak Hellesøy <[EMAIL PROTECTED]>wrote: > When (if) this thread ends, let's start a discussion about indentation > conventions! > Oh... let the pleasure be mine!... and why wait? _EVERYONE_ knows that the only way to indent ruby code is 2 plain spaces. Tabs are

Re: [rspec-users] stepping across features

2008-12-03 Thread Andrew Premdas
Perhaps the creation of the join is not something that should be tested by a feature. This sounds to me like an implementation detail that would be better tested by some sort of unit test. So if your features want to have things in them mentioning joins, databases and other such things then you're

Re: [rspec-users] Indentation Conventions for Ruby and Cucumber

2008-12-03 Thread Andrew Premdas
Oh but cucumber features so want to be idented on the I Scenario: Anonymous user can not duplicate a un-activated account Given I am an anonymous user And a registered user Fred exists When I signup as Fred Then I should see an error Really need to view above with a monspaced fon

Re: [rspec-users] stepping across features

2008-12-03 Thread James Byrne
Andrew Premdas wrote: > Perhaps the creation of the join is not something that should be > tested by a feature. This sounds to me like an implementation detail > that would be better tested by some sort of unit test. So if your > features want to have things in them mentioning joins, databases and

Re: [rspec-users] Any plans for Before-feature or Before-all steps in Cucumber?

2008-12-03 Thread Ashley Moran
On 2 Dec 2008, at 15:26, Joseph Wilk wrote: BeforeAll (Before running any feature) is currently possible through putting something in your env.rb or really any ruby file that gets required. It will be run once (and before anything else). I use this to manage ferret/selenium. The before/after

[rspec-users] Intermittent Cucumber exception

2008-12-03 Thread Ashley Moran
Hi Anyone recognise this exception, and know what causes it to happen occasionally? Thanks Ashley Scenario: new story appears on feed # features/descriptions/ story_notification.feature:12 /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.10/bin/../lib/cuc

Re: [rspec-users] Intermittent Cucumber exception

2008-12-03 Thread Ashley Moran
On 3 Dec 2008, at 15:55, Ashley Moran wrote: Scenario: new story appears on feed # features/descriptions/ story_notification.feature:12 /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.10/bin/../lib/ cucumber/broadcaster.rb:15:in `write': Bad file descriptor

Re: [rspec-users] Intermittent Cucumber exception

2008-12-03 Thread Joseph Wilk
Ashley Moran wrote: On 3 Dec 2008, at 15:55, Ashley Moran wrote: Scenario: new story appears on feed # features/descriptions/story_notification.feature:12 /opt/local/lib/ruby/gems/1.8/gems/cucumber-0.1.10/bin/../lib/cucumber/broadcaster.rb:15:in `write': Bad

Re: [rspec-users] Any plans for Before-feature or Before-all steps in Cucumber?

2008-12-03 Thread Ben Mabey
Ashley Moran wrote: On 2 Dec 2008, at 15:26, Joseph Wilk wrote: BeforeAll (Before running any feature) is currently possible through putting something in your env.rb or really any ruby file that gets required. It will be run once (and before anything else). I use this to manage ferret/seleniu

Re: [rspec-users] Any plans for Before-feature or Before-all steps in Cucumber?

2008-12-03 Thread Ashley Moran
On 3 Dec 2008, at 16:59, Ben Mabey wrote: I agree with Ashley. In the past I have done multiple profiles just as Joseph has suggested. I have then modified my features task to serially run my different feature sets and profiles. With that you do have one task you need to run. However,

Re: [rspec-users] Intermittent Cucumber exception

2008-12-03 Thread Ashley Moran
On 3 Dec 2008, at 16:19, Joseph Wilk wrote: Can you share the arguments in the relevant Cucumber rake task? That would be this: Cucumber::Rake::Task.new do |t| t.cucumber_opts = "--format pretty" t.step_pattern = "features/steps/**/*.rb" end -- http://www.patchspace.co.uk/ http://avie

[rspec-users] Cucumber and Rcov

2008-12-03 Thread James Byrne
I am now trying to get rcov to work for me, without much success. I stole the rake task code from the cucumber site: desc "Run all features" task :features => "features:all" task :features => 'db:test:prepare' require 'cucumber/rake/task' #I have to add this -mischa namespace :features do Cucu

Re: [rspec-users] Cucumber and Rcov

2008-12-03 Thread Mischa Fierer
James, Maybe you are asking something else...but after you type rake feature:rcov there should be a folder in rails root called "features_rcov," which may solve your problem. rake features:rcov open features_rcov/index.html -Mischa On Wed, Dec 3, 2008 at 9:04 PM, James Byrne <[EMAIL PROTECTED]>

Re: [rspec-users] Cucumber and Rcov

2008-12-03 Thread James Byrne
Mischa Fierer wrote: > James, > > Maybe you are asking something else...but after you type rake > feature:rcov > there should be a folder in rails root called "features_rcov," which may > solve your problem. > > rake features:rcov > open features_rcov/index.html > > -Mischa Ah Sometime

Re: [rspec-users] class << self considered harmful... really?

2008-12-03 Thread Pat Maddox
> 'look at me, ma, I'm opening the eigenclass!' "Honey, if you're going to open your eigenclass, do it in your room." ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] stepping across features

2008-12-03 Thread Andrew Premdas
It seems to me that there are all sorts of implementation details in this story that could make your tests quite brittle. And the feature is definitiley a programmer writing a test, rather than a customer specifying what they want. Putting on my customer hat Scenario: Add location Given I have a

[rspec-users] The RSpec way of doing this? Need help on validating block

2008-12-03 Thread Sebastian W.
Hello, I'm back again with more questions about mocks and how to do good testing in general. Let's say I'm writing this EmailSender class and I want to make it totally awesomely tested with RSpec. Here's how far I've gotten so far: require 'net/smtp' class EmailSender def send_email mailer.