Re: [rspec-users] how to play with rSpec using irb

2008-10-15 Thread Alr Alr
> Julius:~ caius$ irb > >> require "spec" > => true > >> include Spec::Matchers > => Object > >> %w(1 2 3).should have(3).items > => true > > C > --- > Caius Durling > [EMAIL PROTECTED] > +44 (0) 7960 268 100 > http://caius.name/ thx, its working. -- Posted via http://www.ruby-forum.com/. __

Re: [rspec-users] Rails config.gem and rspec, rspec-rails

2008-10-15 Thread Juanma Cervera
Zach Dennis wrote: > In #rspec the instructions for installing rspec and rspec-rails on a > Rails project. Specifically talking about the following line from > http://github.com/dchelimsky/rspec-rails/wikis/home > > config.gem "rspec-rails", :lib => "spec" > > I think this should be updated to

[rspec-users] extend Cucumber's arguments

2008-10-15 Thread aidy lewis
Hi, We would like to pass in some additional command line arguments into Cucumber (for example to specify which browser to run the tests with). Is there any way to extend Cucumber's arguments, or could you suggest an alternative way of going about this? Aid __

Re: [rspec-users] extend Cucumber's arguments

2008-10-15 Thread aslak hellesoy
On Wed, Oct 15, 2008 at 12:26 PM, aidy lewis <[EMAIL PROTECTED]> wrote: > Hi, > > We would like to pass in some additional command line arguments into > Cucumber (for example to specify which browser to run the tests with). > > Is there any way to extend Cucumber's arguments, or could you suggest >

Re: [rspec-users] Just a quick question on David's new-controller-examples

2008-10-15 Thread Mark Wilden
I have a different question about the article (pity comments are closed). def mock_account(stubs={}) stubs = { :save => true, :update_attributes => true, :destroy => true, :to_xml => '' }.merge(stubs) @mock_account ||= mock_model(Account, stubs) end With thi

Re: [rspec-users] Just a quick question on David's new-controller-examples

2008-10-15 Thread Shane Mingins
Hi Mark Yeah I was looking at that later on too. And yes if you use in a 'before' it does. Only setting in an 'it' block is ok. I was using this as a quick test as we are on an older version of rspec and I was checking if it may have changed but this fails on 1.1.8 require File.expand_p

[rspec-users] How to spec accessing a constant

2008-10-15 Thread Nick Hoffman
Hi guys. One of my methods uses a constant in another method, like this: class A def something "foo: #{B::BAR}" end end When writing the spec for A#something , how would you mock or stub #{B::BAR}, and how would you set an expectation that B::BAR is used? Thanks, Nick ___

Re: [rspec-users] How to spec accessing a constant

2008-10-15 Thread Craig Demyanovich
Probably, I would just check the outcome of the method instead of checking interaction with a constant. Craig ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to spec accessing a constant

2008-10-15 Thread Zach Dennis
On Wed, Oct 15, 2008 at 4:39 PM, Craig Demyanovich <[EMAIL PROTECTED]> wrote: > Probably, I would just check the outcome of the method instead of checking > interaction with a constant. > What he said, -- Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com

Re: [rspec-users] autotest with a non-rspec project

2008-10-15 Thread Jon Dahl
I'm getting the same error - I'm using Test::Unit with Shoulda for this particular project, and can't autotest because it is trying to load autotest/rails_rspec. David Chelimsky wrote: > The only reason that I know of that this would be happening would be > that there are both a spec directory i

Re: [rspec-users] How to spec accessing a constant

2008-10-15 Thread Nick Hoffman
On 2008-10-15, at 16:39, Craig Demyanovich wrote: Probably, I would just check the outcome of the method instead of checking interaction with a constant. Craig So you guys wouldn't worry about the spec for class A being coupled to this constant in class B? -Nick __

Re: [rspec-users] How to spec accessing a constant

2008-10-15 Thread Craig Demyanovich
On Wed, Oct 15, 2008 at 8:47 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: > On 2008-10-15, at 16:39, Craig Demyanovich wrote: > >> Probably, I would just check the outcome of the method instead of checking >> interaction with a constant. >> >> Craig >> > > So you guys wouldn't worry about the spec

Re: [rspec-users] autotest with a non-rspec project

2008-10-15 Thread David Chelimsky
On Wed, Oct 15, 2008 at 8:24 PM, Jon Dahl <[EMAIL PROTECTED]> wrote: > I'm getting the same error - I'm using Test::Unit with Shoulda for this > particular project, and can't autotest because it is trying to load > autotest/rails_rspec. > > David Chelimsky wrote: >> The only reason that I know of t

Re: [rspec-users] How to spec accessing a constant

2008-10-15 Thread Scott Taylor
On Oct 15, 2008, at 4:31 PM, Nick Hoffman wrote: Hi guys. One of my methods uses a constant in another method, like this: class A def something "foo: #{B::BAR}" end end When writing the spec for A#something , how would you mock or stub #{B::BAR}, and how would you set an expe

[rspec-users] testing a render layout statement in a controller

2008-10-15 Thread Dave Gamphani Phiri
I am new to rSpec and I am writing a test for a controller which has already been developed This is the example in my reports_controller_spec.rb: it "should render the layouts/menu template" do get :select_missing_persons response.should render_template("layouts/menu") end and this is th

Re: [rspec-users] testing a render layout statement in a controller

2008-10-15 Thread wei wei
Try to write a customized matcher, here is an example # custom matchers #- class UseLayout def initialize(expected) @expected = 'layouts/' + expected + '_layout' end def matches?(controller) @actual = controller.layout [EMAIL PROTECTED](@expected)