Re: [rspec-users] How can I use nested "before" functions?

2010-12-03 Thread David Chelimsky
On Dec 3, 2010, at 8:11 PM, Erik Helin wrote: > > > On Fri, Dec 3, 2010 at 16:43, Matt Wynne wrote: > > On 1 Dec 2010, at 05:47, helino wrote: > > > Hi everyone, > > > > I've started learning Ruby and RSpec, and I've ran into a small > > problem. I have one "before" functions which run befor

Re: [rspec-users] Metadata about formatter being used accessible in spec?

2010-12-03 Thread David Chelimsky
On Dec 2, 2010, at 4:53 AM, Piotr Zolnierek wrote: > Is it possible to read which formatter is being used? For instance if - > f d is used to output additional information or is there a better way > to do that? For now you can get it from RSpec.configuration.formatter, but that is a) unofficial

[rspec-users] Getting color to work with jruby

2010-12-03 Thread Bradley
I'm having issues getting color to work when I'm running my tests. I'm writing a gem and using RSpec 2.1.0. I'm using JRuby-1.5.3 installed by RVM on OSX10.6 I have a rake task defined like so: Rspec::Core::RakeTask.new(:spec) do |spec| spec.pattern = "spec/**/*_spec.rb" spec.rspec_opts = ['

[rspec-users] [rspec-rails] Configuring which ExampleGroup gets instantiated

2010-12-03 Thread Ilya P.
Hi all, I've spent a fair bit of time googling but couldn't find the answer to this question. Any insight would be greatly appreciated. Basically I'm specking my ActionMailer instance & I would like to use ControllerExampleGroup's method assigns(). How can I specify which type of ExampleGroup rspe

[rspec-users] Testing html email content with have_selector rspec2 rails3 fails

2010-12-03 Thread Rob Aldred
Previously on rails 2.x I have been able to test the content of my html actionmailer emails. In rspec 1.x: @mailer = OrderMailer.create_receipt(@order) @mailer.body.should have_tag('.order_number') @mailer.body.should have_tag('.billing_address') @mailer.body.should have_tag('.delivery_address')

Re: [rspec-users] Speccing a model class method in Rails produces nil

2010-12-03 Thread David Chelimsky
On Dec 3, 2010, at 11:07 AM, Martin Hawkins wrote: > Ruby 1.9.2, Rails 3.0.3, Rspec-rails 2.2.0 > > I have: > > Factory.define :season_date do |f| > f.season_date Date.new(2011,9,24) > f.date_type "season_start" > end > > RSpec.configure do |config| > config.mock_with :rspec > end > > Facto

Re: [rspec-users] Meaningless stacktrace on RSpec error (no line of error)

2010-12-03 Thread David Chelimsky
On Dec 2, 2010, at 4:31 AM, Log0 wrote: > Hi all, > > I am new to RSpec, currently using rspec-rails (2.1.0) with rails (2.2.3) For rails-2 you need to use rspec-rails-1.3.1 (rspec-rails-2.x supports only rails ~> 3.0). > and ruby (1.8.7). I can get RSpec running however the stacktrace when i

Re: [rspec-users] rspec: command not found

2010-12-03 Thread cardeo
I'm having a similar problem. Marnen Laibow-Koser-2 wrote: > > I am new to ROR. Trying to going through tutorial, but couldn't run > rspec (command not found). Everything was installed as directed. > Search the hold drive, found spec file and spec.bat in the following > directories > > ./us

Re: [rspec-users] Rspec2 and autotest

2010-12-03 Thread David Chelimsky
On Dec 2, 2010, at 10:12 AM, Martin Volerich wrote: > David: > > Glad to see that your book was just published. It's been a life-changing read! > > I'm struggling with the best way to integrate autotest working in a rails > project with RSpec 2. The latest autotest 4.4.6 gem seems to retire it a

Re: [rspec-users] How can I use nested "before" functions?

2010-12-03 Thread Erik Helin
On Fri, Dec 3, 2010 at 16:43, Matt Wynne wrote: > > On 1 Dec 2010, at 05:47, helino wrote: > > > Hi everyone, > > > > I've started learning Ruby and RSpec, and I've ran into a small > > problem. I have one "before" functions which run before all my > > descriptions and the context in the spec, an

Re: [rspec-users] Global before blocks - filtering by multiple types

2010-12-03 Thread David Chelimsky
On Dec 2, 2010, at 4:20 AM, Andi Schacke wrote: > Hi > > in the config block of rspec I have a before block to reset my > database before each spec: > > config.before(:each) {DatabaseCleaner.clean} > > I know I can apply this before to a specific type, e.g. > > config.before(:each, :type => :

Re: [rspec-users] Routes are not recognized in request specs after upgrading to 2.2

2010-12-03 Thread David Chelimsky
On Nov 29, 2010, at 2:24 PM, E. Litwin wrote: > I'm getting undefined local variable or method `users_path' (as an > example) my request spec tests after upgrading to 2.2.0 from 2.1.0. Grab the rspec-rails-2.2.1 release, which fixed a bug that I think, as a side-effect, will resolve your issue.

Re: [rspec-users] How can I use nested "before" functions?

2010-12-03 Thread Matt Wynne
On 1 Dec 2010, at 05:47, helino wrote: > Hi everyone, > > I've started learning Ruby and RSpec, and I've ran into a small > problem. I have one "before" functions which run before all my > descriptions and the context in the spec, and then I have another > "before" function inside a context, whi

Re: [rspec-users] [Sinatra] "tried to create Proc object without a block"

2010-12-03 Thread Ernst Arnold
I adapted the first lines of service_spec.rb according to Jason's code: require File.dirname(__FILE__) + '/../service' require 'rspec' # was 'spec' (Jason) #require 'spec/interop/test' # no idea what this was require 'rack/test' require 'test/unit'

[rspec-users] How can I use nested "before" functions?

2010-12-03 Thread helino
Hi everyone, I've started learning Ruby and RSpec, and I've ran into a small problem. I have one "before" functions which run before all my descriptions and the context in the spec, and then I have another "before" function inside a context, which is set to run once before all the "it" inside that

[rspec-users] Metadata about formatter being used accessible in spec?

2010-12-03 Thread Piotr Zolnierek
Is it possible to read which formatter is being used? For instance if - f d is used to output additional information or is there a better way to do that? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-us

[rspec-users] Rspec2 and autotest

2010-12-03 Thread Martin Volerich
David: Glad to see that your book was just published. It's been a life-changing read! I'm struggling with the best way to integrate autotest working in a rails project with RSpec 2. The latest autotest 4.4.6 gem seems to retire it as a standalone gem and go back to ZenTest - which I assume does

[rspec-users] Routes are not recognized in request specs after upgrading to 2.2

2010-12-03 Thread E. Litwin
I'm getting undefined local variable or method `users_path' (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven't really changed these tests from the generated code but am curious as to why they are failing now. require 'spec_helper' describe "Users" do describe

Re: [rspec-users] [Sinatra] "tried to create Proc object without a block"

2010-12-03 Thread Jason Edwards
Yeah, that's a major pain... I put my stuff up here: https://gist.github.com/720605 And later on I found: https://github.com/pauldix/service-oriented-design-with-ruby I tried to include comments about what I changed to get it to work. When I found pauldix's, it looked like he had made pretty muc

[rspec-users] Meaningless stacktrace on RSpec error (no line of error)

2010-12-03 Thread Log0
Hi all, I am new to RSpec, currently using rspec-rails (2.1.0) with rails (2.2.3) and ruby (1.8.7). I can get RSpec running however the stacktrace when it happened is pretty uninformative, always not including the line in which the assertion failed. I tried to google around for some keywords but d

[rspec-users] Global before blocks - filtering by multiple types

2010-12-03 Thread Andi Schacke
Hi in the config block of rspec I have a before block to reset my database before each spec: config.before(:each) {DatabaseCleaner.clean} I know I can apply this before to a specific type, e.g. config.before(:each, :type => :model) {DatabaseCleaner.clean} but what I want to achieve is that the

[rspec-users] Routes are not recognized in request specs after upgrading to 2.2

2010-12-03 Thread E. Litwin
I'm getting undefined local variable or method `users_path' (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven't really changed these tests from the generated code but am curious as to why they are failing now. require 'spec_helper' describe "Users" do describe

[rspec-users] Routes are not recognized in request specs after upgrading to 2.2

2010-12-03 Thread E. Litwin
I'm getting undefined local variable or method `users_path' (as an example) my request spec tests after upgrading to 2.2.0 from 2.1.0. I haven't really changed these tests from the generated code but am curious as to why they are failing now. require 'spec_helper' describe "Users" do describe

Re: [rspec-users] [Sinatra] "tried to create Proc object without a block"

2010-12-03 Thread Ernst Arnold
I get the same error message as Jason. However installing rack-test did not help in my case. (I am new to Ruby, and don't yet know how to use the debugger) Tried with rvm use 1.9.2 and rvm use 1.8.7 Generally I am a bit disappointed that the code from the book needed a number of changes to get

[rspec-users] Speccing a model class method in Rails produces nil

2010-12-03 Thread Martin Hawkins
Ruby 1.9.2, Rails 3.0.3, Rspec-rails 2.2.0 I have: Factory.define :season_date do |f| f.season_date Date.new(2011,9,24) f.date_type "season_start" end RSpec.configure do |config| config.mock_with :rspec end Factory.define :season_date do |f| f.season_date Date.new(2011,9,24) f.date_ty

Re: [rspec-users] stub! does not work

2010-12-03 Thread David Chelimsky
On Dec 3, 2010, at 5:37 AM, Zhi-Qiang Lei wrote: > Hi, > > This piece of code does not work. Does anybody know the cause? > > > describe "/loan-events/{source-id}-lend.json" do >describe "GET" do > it "should call all method of LoanEvent with source_id" do >source_id = rand(10

[rspec-users] stub! does not work

2010-12-03 Thread Zhi-Qiang Lei
Hi, This piece of code does not work. Does anybody know the cause? describe "/loan-events/{source-id}-lend.json" do describe "GET" do it "should call all method of LoanEvent with source_id" do source_id = rand(1000) LoanEvent.should_receive(:all).with(:source_id => so