[rspec-users] using rspec in a non-rails environment

2012-04-23 Thread S Ahmed
My folder structure is as follows: /myapp/ /myapp/lib/class1.rb /myapp/rspec/spec_helper.rb /myapp/rspec/lib/class1_spec.rb My spec_helper has: require 'rubygems' require 'rspec' RSpec.configure do |config| end My class1_spec.rb has: require 'spec_helper' require '../../lib/class1' describ

Re: [rspec-users] using rspec in a non-rails environment

2012-04-23 Thread David Chelimsky
On Mon, Apr 23, 2012 at 12:26 PM, S Ahmed wrote: > My folder structure is as follows: > > /myapp/ > /myapp/lib/class1.rb > > /myapp/rspec/spec_helper.rb > /myapp/rspec/lib/class1_spec.rb > > My spec_helper has: > > require 'rubygems' ^^ If you've installed rspec as a gem and you're running the rs

Re: [rspec-users] using rspec in a non-rails environment

2012-04-23 Thread S Ahmed
ok have to lookup what rspec/autorun does as oppose to just 'require "rspec"' thanks, it is now working :) feels good! I've always been tied to rails, seems like I was spoiled and not sure how to do basic things in ruby On Mon, Apr 23, 2012 at 1:42 PM, David Chelimsky wrote: > On Mon, Apr

Re: [rspec-users] One error reported recursively if two pages visited by request spec

2012-04-23 Thread Mark Berry
Yup that fixed it, thanks! Mark Berry On Sun, Apr 22, 2012 at 2:41 AM, David Chelimsky wrote: > Looks like this is related > to https://github.com/rspec/rspec-core/issues/585, which is already fixed in > master. If you point your Gemfile to github now you'll see it fixed. 2.10 > release coming s

[rspec-users] How to modify database inside a transaction in before(:all)?

2012-04-23 Thread Rodrigo Rosenfeld Rosas
I have a set of examples that should run with a specific set of records in the database. Since setting those records is an expensive operation I'd like to perform it just once per context. For example: context 'sample tree' do before(:all) { create_tree_records } example ... end Th

Re: [rspec-users] How to modify database inside a transaction in before(:all)?

2012-04-23 Thread David Chelimsky
On Mon, Apr 23, 2012 at 5:39 PM, Rodrigo Rosenfeld Rosas wrote: > I have a set of examples that should run with a specific set of records in > the database. > > Since setting those records is an expensive operation I'd like to perform it > just once per context. > > For example: > > context 'sampl

Re: [rspec-users] How to modify database inside a transaction in before(:all)?

2012-04-23 Thread Rodrigo Rosenfeld Rosas
Em 23-04-2012 20:04, David Chelimsky escreveu: On Mon, Apr 23, 2012 at 5:39 PM, Rodrigo Rosenfeld Rosas wrote: I have a set of examples that should run with a specific set of records in the database. Since setting those records is an expensive operation I'd like to perform it just once per co