[rspec-users] No examples were matched.

2011-01-12 Thread Nadal
I am using rspec-rails 2.4.1 on a rails3 (3.0.3) app. I have around 20 specs. When I run rake spec all 20 specs run fine. However when I do bundle exec rspec then I get this message. No examples were matched. Perhaps {:unless=>#, :if=>#} is excluding everything? __

Re: [rspec-users] Looking for a gem which uses rspec for testing and tests need to deal with database

2011-01-04 Thread Nadal
Thank you Nick. That's exactly what I was looking for. Also I keep forgetting about ruby-toolbox.com so thanks for pointing that out too. On Jan 4, 11:32 am, Nick wrote: > How about vestal_versions?https://github.com/laserlemon/vestal_versions > > I found it by going to Ruby Toolbox, and lookin

[rspec-users] Looking for a gem which uses rspec for testing and tests need to deal with database

2011-01-04 Thread Nadal
Let's say that I develop a gem which adds a new method to ActiveRecord . Now I want to test this method using rspec. I am able to get started but not sure where to put the database.yml for testing purpose. I was wondering if there is a gem out there which uses rspec for testing and has to interact

Re: [rspec-users] Not sure why let is not doing the same thing as traditional test

2010-11-03 Thread Nadal
ped" in a before(:each) filter. > > So, you want to use #let! > > On Nov 2, 7:55 pm, Nadal wrote: > > > > > > > > > Here is my test which passes. > > >    before do > >         @page = Factory(:page) > >         @note = Fa

[rspec-users] Not sure why let is not doing the same thing as traditional test

2010-11-02 Thread Nadal
Here is my test which passes. before do @page = Factory(:page) @note = Factory(:note, :page => @page, :title => 'super cool') end it 'has size 1' do @page.notes.size.should == 1 end I read rspec book and wanted to use let. Here is my implementation. A

Re: [rspec-users] rspec2 not working with shoulda

2010-08-11 Thread Nadal
oulda been "shoulda not working > > with rspec-2" ;) > > It's been a long time since I tried shoulda, but I used to like to give the > advice, "you shoulda used RSpec instead." ;-) > > Hope you get everything working, Nadal. > > Regards, > Craig

[rspec-users] rspec2 not working with shoulda

2010-08-11 Thread Nadal
I am using rails edge. I am using gem "rspec-rails", "= 2.0.0.beta. 19" . I have following code at spec/models/user_spec.rb require 'spec_helper' describe User do it { should validate_presence_of(:email) } it { should validate_presence_of(:name) } end Here is my gemfile group :developm

Re: [rspec-users] How do I improve the readability of my specs

2010-05-27 Thread Nadal
helimsky wrote: > > > > > > > On May 26, 2010, at 9:37 PM, Nadal wrote: > > >> Here is my spec. > > >> describe Exception2db do > >> context "attributes" do > >>   subject { Exception2db.create(:exception => $exce

[rspec-users] How do I improve the readability of my specs

2010-05-26 Thread Nadal
Here is my spec. describe Exception2db do context "attributes" do subject { Exception2db.create(:exception => $exception_data_xml) } specify { subject.controller.should == 'exception2db/main' } specify { subject.error_message.should == 'RuntimeError: 46' } specify { subject.user

Re: [rspec-users] old crumbly rspec

2010-05-26 Thread Nadal
I knew its existed but did not know any use case. Thanks for an excellent example. As you said in some cases its might make sentence more readable. good stuff. On May 26, 5:46 pm, David Chelimsky wrote: > On May 26, 2010, at 4:05 PM, Nadal wrote: > > > > > > > As

Re: [rspec-users] old crumbly rspec

2010-05-26 Thread Nadal
As David said, there is no difference between "it" and "specify". One of them is alias of other one. However semantically you can use them differently. The two examples given below are same. However second one reads better. I like to use specify when I have explicitly created a subject. Implicit s

Re: [rspec-users] Why pending only works inside it

2010-05-26 Thread Nadal
awesome. That's much better. On May 26, 4:28 pm, David Chelimsky wrote: > On May 26, 2010, at 3:04 PM, Nadal wrote: > > > Thanks. That got me moving. > > > I like how in rspec I can say context when I mean context and describe > > when I mean describe. Going by t

Re: [rspec-users] Why pending only works inside it

2010-05-26 Thread Nadal
nitpicking but paying attention to such detail has made rspec so great. Just a fresh perspective since I am trying out rspec for the first time. On May 26, 2:20 pm, Scott Taylor wrote: > On May 26, 2010, at 2:07 PM, Nadal wrote: > > > > > > > I wrote following

[rspec-users] Why pending only works inside it

2010-05-26 Thread Nadal
I wrote following code and it did not work. describe User do it { should validate_presence_of(:email) } pending "should raise an error when email is blank and record is saved with false option" end Then I put pending inside it like one given below and it worked. describe User do it { shoul

Re: [rspec-users] Not able to run tests for rspec itself

2010-05-24 Thread Nadal
Creating an empty ~/.rubyforge/user-config.yml did it. >$ rake spec warning: couldn't activate the rubyforge plugin, skipping Profiling enabled. . Thanks a bunch. On May 23, 7:04 pm, David Chelimsky wrote: > On Sun, May 23, 2010 at 3:50 PM, Nadal wrote: > &g

Re: [rspec-users] Not able to run tests for rspec itself

2010-05-23 Thread Nadal
Did everything that was instructed. Still the same error. No such file or directory - /Users/nadal/.rubyforge/user-config.yml On May 23, 11:35 am, David Chelimsky wrote: > On May 22, 2010, at 5:41 PM, Nadal wrote: > > > > > > > I am talking about rspec itself and r

Re: [rspec-users] Not able to run tests on rails

2010-05-22 Thread Nadal
Got it. File name should be user_spec.rb and not user_test.rb . On May 22, 8:42 pm, Nadal wrote: > This is what I did. Please tell me where did I go wrong. > > # I am using rails 2.3.5 > rails demo > cd demo > ruby script/generate scaffold User name:string > r

[rspec-users] Not able to run tests on rails

2010-05-22 Thread Nadal
This is what I did. Please tell me where did I go wrong. # I am using rails 2.3.5 rails demo cd demo ruby script/generate scaffold User name:string rake db:migrate rake db:test:prepare ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.9' ruby script/plugin instal

[rspec-users] Not able to run tests for rspec itself

2010-05-22 Thread Nadal
I am talking about rspec itself and running tests written for rspec. This is what I did. > git clone http://github.com/dchelimsky/rspec.git > cd rspec > rake test I am getting following error rake aborted! No such file or directory - /Users/nadal/.rubyforge/user-config.yml /usr/local

[rspec-users] A full rails application with rspec test code

2010-05-16 Thread Nadal
I used bostonrb code base http://github.com/bostonrb/bostonrb to learn about shoulda. Similarly is there a decent rails based application with test code in rspec to see how to write good rspec test code at both unit and functional level. I am trying to get started with rspec. Thanks _