[rspec-devel] [ rspec-Feature Requests-12628 ] Integrate rbehave into rspec
noreply at rubyforge.org
noreply at rubyforge.org
Mon Aug 27 17:58:05 EDT 2007
Feature Requests item #12628, was opened at 2007-07-27 13:33
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=12628&group_id=797
Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Dan North (tastapod)
>Assigned to: Dan North (tastapod)
Summary: Integrate rbehave into rspec
Initial Comment:
rbehave is a story/scenario description framework that describes behaviour for an application in the same way that rspec describes behaviour for objects.
It would make sense for rspec to contain rbehave in a "story" module (spec/story) so that rspec becomes a "full stack" BDD framework.
This initial feature request is simply to bring rbehave into the rspec project. Further work (ie. further feature requests) would create closer integration between the two, and providing a way to describe Rails behaviour at a story/scenario level.
----------------------------------------------------------------------
Comment By: Ian Dees (undees)
Date: 2007-07-28 16:48
Message:
I like the idea. As long as it doesn't invalidate all those GUI tests I've written in RSpec.... ;-)
----------------------------------------------------------------------
Comment By: Michael Klishin (michaelklishin)
Date: 2007-07-28 12:14
Message:
RBehave is great, plus one for it. The only problem is that it is poorly documented. And yes, I'd like to submit a patch when I get deep enough in the source.
----------------------------------------------------------------------
Comment By: Yurii Rashkovskii (yrashk)
Date: 2007-07-28 11:59
Message:
First of all, thank you for your nice DSL
Then, here is a draft version of code that isolates scenarios into ActiveRecord transactions (extract from my project)
class ActiveRecordSafetyListener
include Singleton
def scenario_started(*args)
unless Rails::VERSION::STRING == "1.1.6"
ActiveRecord::Base.send :increment_open_transactions
end
ActiveRecord::Base.connection.begin_db_transaction
end
def scenario_succeeded(*args)
ActiveRecord::Base.connection.rollback_db_transaction
unless Rails::VERSION::STRING == "1.1.6"
ActiveRecord::Base.send :decrement_open_transactions
end
end
alias :scenario_pending :scenario_succeeded
alias :scenario_failed :scenario_succeeded
end
class RBehave::Runner::ScenarioRunner
def initialize
@listeners = [ActiveRecordSafetyListener.instance]
end
end
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=12628&group_id=797
More information about the rspec-devel
mailing list