Re: [rspec-users] Running RSpec from within my Ruby application

2008-09-28 Thread Daniel Lucraft
--- Scott Taylor <[EMAIL PROTECTED]> wrote: > I'm missing the why. What is the higher-level objective that you're > trying to accomplish? Seems like you want something like autotest + a > custom formatter? The app (www.redcaride.com) has a plugin system with reloading, which lets you wor

[rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Ashley Moran
Hi Just had a surprising result: it "should not appear in the Story.unposted list" do @story.save lambda { @story.post_to_twitter(@twitter_client) }.should change { Story.unposted }.from([EMAIL PROTECTED]).to([]) end 'Story#post_to_twitter should not appear in the Story.un

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 9:47 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Hi > > Just had a surprising result: > > it "should not appear in the Story.unposted list" do >@story.save >lambda { > @story.post_to_twitter(@twitter_client) >}.should change { Story.unposted }.from([EMAIL

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 10:43 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 9:47 AM, Ashley Moran > <[EMAIL PROTECTED]> wrote: >> Hi >> >> Just had a surprising result: >> >> it "should not appear in the Story.unposted list" do >>@story.save >>lambda { >> @s

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 11:01 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 10:43 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Sun, Sep 28, 2008 at 9:47 AM, Ashley Moran >> <[EMAIL PROTECTED]> wrote: >>> Hi >>> >>> Just had a surprising result: >>> >>> it "should

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Michael Latta
David, It seems to me that the root of the problem is that the specification is incorrect. Since Rails returns association proxies the specification fails because it does not specify what the behavior should be. I would suggest that instead of patching the change matcher, that you shoul

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Michael Latta
Is your patch AR proxy specific? If it is for any collection, it prevents two collections from being compared for equality. I have had many examples of collections that are not simple containers, and only comparing the contents would be equally invalid as the simple equality on AR proxies

[rspec-users] Lot's o' questions about Cucumbert

2008-09-28 Thread Fernando Perez
Is there somewhere a real documentation about using Cucumber + Webrat in a Rails project? For instance it seems that Cucumber doesn't understand the word "Given" like Story Runner does. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing l

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 1:44 PM, Michael Latta <[EMAIL PROTECTED]> wrote: > Is your patch AR proxy specific? If it is for any collection, it prevents > two collections from being compared for equality. I have had many examples > of collections that are not simple containers, and only comparing th

Re: [rspec-users] Lot's o' questions about Cucumbert

2008-09-28 Thread Scott Taylor
On Sep 28, 2008, at 2:50 PM, Fernando Perez wrote: Is there somewhere a real documentation about using Cucumber + Webrat in a Rails project? For instance it seems that Cucumber doesn't understand the word "Given" like Story Runner does. -- How about this? http://github.com/aslakhelleso

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 1:18 PM, Michael Latta <[EMAIL PROTECTED]> wrote: > David, > > It seems to me that the root of the problem is that the specification is > incorrect. Since Rails returns association proxies the specification fails > because it does not specify what the behavior should be. I

Re: [rspec-users] Lot's o' questions about Cucumbert

2008-09-28 Thread Fernando Perez
Bloody keyboard! del and enter keys are too close to one another... So my other questions are: - Where does Cucumber take its DB data from? Does it use the dev DB? Does it copy the data from my dev DB into the test DB? When I run rake features while my dev mongrel is running, I see some stuff g

Re: [rspec-users] Lot's o' questions about Cucumbert

2008-09-28 Thread David Chelimsky
On Sun, Sep 28, 2008 at 1:55 PM, Fernando Perez <[EMAIL PROTECTED]> wrote: > Bloody keyboard! del and enter keys are too close to one another... > > So my other questions are: > > - Where does Cucumber take its DB data from? Does it use the dev DB? > Does it copy the data from my dev DB into the te

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Michael Latta
The constraint looks good. ar_proxy_of(...) for this case? Or is your constraint specified as making a copy? Your patch seems to be narrow enough that that is also workable. As you say, it is Rails that is causing the surprise. Michael On Sep 28, 2008, at 11:52 AM, David Chelimsky wro

Re: [rspec-users] Stubbing renders

2008-09-28 Thread Nick Hoffman
On 2008-09-28, at 16:33, Nick Hoffman wrote: Hi guys. I'm curious to know why this method of stubbing a render fails: ActionController::Base.stub!(:render_to_string).and_return 'something' And why this is [one of] the correct methods: controller.stub_render :partial => '/some/partial' Cheers,

[rspec-users] Stubbing renders

2008-09-28 Thread Nick Hoffman
Hi guys. I'm curious to know why this method of stubbing a render fails: ActionController::Base.stub!(:render_to_string).and_return 'something' And why this is [one of] the correct methods: controller.stub_render :partial => '/some/partial' Cheers, Nick __

Re: [rspec-users] webrat the way to go?

2008-09-28 Thread Willem van den Ende
Hi, I just started playing with cucumber On Wed, 2008-09-17 at 22:44 +0200, aslak hellesoy wrote: > If you already know RSpec I think you'd pick it up faster. Cucumber > has some documentation that might be helpful: > http://github.com/aslakhellesoy/cucumber/wikis/ruby-on-rails > Definitely help

Re: [rspec-users] Why no rspec-rails gem?

2008-09-28 Thread Pat Maddox
Tim Harper <[EMAIL PROTECTED]> writes: > I was getting a little tired of adding 2 plugins every time I create a > new rails project, so I just built an rspec-rails gemspec, and it > works perfectly well. Does anybody know why there isn't a public > rspec-rails gem? I don't know if I should be as

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Pat Maddox
Michael Latta <[EMAIL PROTECTED]> writes: > David, > > It seems to me that the root of the problem is that the specification > is incorrect. Since Rails returns association proxies the > specification fails because it does not specify what the behavior > should be. I would suggest that instead o

Re: [rspec-users] Lot's o' questions about Cucumbert

2008-09-28 Thread Fernando Perez
Thank you David, Is there a way to skip database initialization? Because it takes too much time to run each test. Is there a similar way to mock objects or create objects and have them "saved" in memory? I don't understand how to do that. I use for instance Product.create!(:title => 'title', :

[rspec-users] Not seeing an RJS change

2008-09-28 Thread Nick Hoffman
I'm writing specs for an XHR, and am having troubles getting my specs to see that a is being hidden. === map_filter.rjs 19 else 20 puts "map_filter.rjs> else!" 21 # Display the filter errors. 22 page['map-filter-errors'].hide 23 page['map-filter-errors'].replace_html @map_filter_err

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Ashley Moran
On Sep 28, 2008, at 5:01 pm, David Chelimsky wrote: Wow. OK - here's what I figured out. Talk about insidious bugs! This is actually quite a bit different from what I thought. There are two lambdas involved here: lambda { 1st lambda: expression that should cause the change }.should change{

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Ashley Moran
On Sep 28, 2008, at 7:52 pm, David Chelimsky wrote: What you're proposing could be resolved with an argument constraint that's been discussed in some other threads on this list - something like: lambda {...}.should change{...}.to(array_consisting_of(...)) I'd prefer this as it lets us keep t

[rspec-users] Best way to determine if RSpec is loaded?

2008-09-28 Thread Ashley Moran
Hi I've been using the Twitter gem, but I discovered it loads ActiveSupport, which meddles with Kernel#require and generally causes me confusion and pain. I don't need Twitter loaded for my specs, currently I'm doing this: require 'twitter' unless Object.const_defined?(:Spec) Is there

Re: [rspec-users] Should change not comparing arrays how I expected

2008-09-28 Thread Michael Latta
I think the difference comes down to whether you are writing specs or tests. It is good enough for RSpec or Cucumber to fake out AR proxies if all you are doing is testing something. If it is a spec, then I believe that having the framework fake out the test is very dangerous, because a r

[rspec-users] [ANN] RSpec-1.1.5 has been released

2008-09-28 Thread David Chelimsky
RSpec-1.1.5 has been released RSpec is a Behaviour Driven Development framework for Ruby. RSpec-1.1.5 has a ton of minor changes and bug fixes, and a few major ones. Please see the following for more information: http://rspec.info/rdoc/files/History_txt.html http://rspec.info/rdoc-rails/files/H

Re: [rspec-users] Not seeing an RJS change

2008-09-28 Thread Nick Hoffman
On 2008-09-28, at 17:20, Nick Hoffman wrote: 431 it 'should hide the map filter errors ' do 432 do_xhr @xhr_params 433 response.should have_rjs 434 # response.should have_rjs(:hide, 'map-filter-errors') 435 end I just discovered that I need to pass :

Re: [rspec-users] [ANN] RSpec-1.1.5 has been released

2008-09-28 Thread Mikel Lindsaar
On Mon, Sep 29, 2008 at 12:07 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > RSpec-1.1.5 has been released rspec_team.should_receive(:thank_you).at_least(:once) GmailMailer.post(email) -- http://lindsaar.net/ Rails, RSpec and Life blog ___ rspec

Re: [rspec-users] webrat the way to go?

2008-09-28 Thread Willem van den Ende
On Sun, 2008-09-28 at 22:24 +0200, Willem van den Ende wrote: > When I go to invitation/new, I see the Subject field, but WebRat doesn't... : > When I fill in "Subject" with "My invitation subject" > Could not find [Webrat::TextField, Webrat::TextareaField, > Webrat::PasswordField]: "S

Re: [rspec-users] webrat the way to go?

2008-09-28 Thread aslak hellesoy
On Mon, Sep 29, 2008 at 8:46 AM, Willem van den Ende <[EMAIL PROTECTED]> wrote: > On Sun, 2008-09-28 at 22:24 +0200, Willem van den Ende wrote: > >> When I go to invitation/new, I see the Subject field, but WebRat doesn't... : > >> When I fill in "Subject" with "My invitation subject" >>