Re: [rspec-users] How to run example group in transaction

2011-03-04 Thread Jim Morris
In your spec_helper... RSpec.configure do |config| # setup transactional factory for sequel, when running transactional tests config.around(:each, :transactional => true) do |example| Sequel::DATABASES.first.transaction do example.run raise Sequel::Error::Rollback end en

[rspec-users] How to run example group in transaction

2011-03-04 Thread Zhi-Qiang Lei
Dear All, I want to wrap my example group in transaction to avoid record being created. How should I do? My rspec is 2.5.1, and ORM is Sequal. This way does not work for me. Thanks. class RSpec::Core::ExampleGroup def self.run(reporter) DB.transaction { super(reporter); raise(Sequel::Erro

[rspec-users] Rails 3.0.1 and rspec-rails assign issue: render doesn't have instance var

2011-03-04 Thread Brian Ledsworth
If you find the exception "undefined method 'model_name' for NilClass:Class" in view specs with Rails 3.0.1 and rspec-rails2, I believe it's a Rails issue. I receive the exception after calling render in my view spec, which indicates the @player instance var does not exist in the view. To trouble

Re: [rspec-users] Ruby Debugger - not working in rspec?

2011-03-04 Thread Jason Nah
Hi David, I found the problem. I had --drb option on, which caused all sorts of problems with the debugger. It would just skip right through the breakpoint/debugger statements with the --drb option on. Even though spork wasn't running. Removing the option got the debugger back on track. Cheers,

Re: [rspec-users] Ruby Debugger - not working in rspec?

2011-03-04 Thread David Chelimsky
On Mar 3, 2011, at 11:44 PM, Jason Nah wrote: > Howdy, > > I'm trying to get the ruby debugger to breakpoint at a specific line in > source. > > Here's what I did: > Added require "ruby-debug" in spec_helper.rb You don't need this ^^. > Added gem dependency to Gemfile (gem "ruby-debug" > In the

Re: [rspec-users] How to intercept an instance method from StdLib (1.9.2)

2011-03-04 Thread Matt Wynne
On 4 Mar 2011, at 05:45, Hedge Hog wrote: > Hi, > I'm struggling with something that seems to be simple, and I've not > had any joy following the RSpec books suggestions (p. 187). > I'd like to test that a method raises and error when a file is not found. > I've tried adding this in my example ju