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?
__
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
_
20 matches
Mail list logo