[rspec-users] [Cucumber] LinkedIn group & cocktail recipe

2009-03-21 Thread Ashley Moran
Hi all For no other good reason than I wanted the Cucumber logo on my LinkedIn profile - and I'm addicted to creating stuff on LinkedIn - I created a Cucumber group[1]. Well there is one good reason - more and more people I'm meeting are looking at Cucumber and using it without considerin

Re: [rspec-users] Expecting a block to return a specific value

2009-03-21 Thread Zach Dennis
2009/3/21 Guilherme Machado Cirne : > Hi, > > I have the following method in a Rails view helper: > > def title >   content_for(:title) do >     # some code which generates a title dynamically >   end > end > > How can I spec that the code inside the block returns the correct title? My preference

Re: [rspec-users] New User Issues

2009-03-21 Thread Scott LaBounty
David, Thanks for the help. On the cucumber/hoe issue, I am running gem version 1.2.0 and when I did a "sudo gem update --system", I got a "Nothing to update". That may not have been what I'm seeing. The --color makes things look right. Thanks again, Scott On Sat, Mar 21, 2009 at 7:54 AM, David

Re: [rspec-users] Testing return value of a block argument

2009-03-21 Thread Mark Wilden
On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong wrote: > > i.e. something like: >  log_mock.should_receive(:debug) { |log_block| >    # execute log_block, and check its return value >  } I suppose you could always look at the source code for the debug method, find out what it does with the result

[rspec-users] Expecting a block to return a specific value

2009-03-21 Thread Guilherme Machado Cirne
Hi, I have the following method in a Rails view helper: def title content_for(:title) do # some code which generates a title dynamically end end How can I spec that the code inside the block returns the correct title? TIA, -- Guilherme Machado Cirne gci...@gmail.com __

Re: [rspec-users] Testing return value of a block argument

2009-03-21 Thread Guilherme Machado Cirne
I have this exact same problem. Anyone have a solution? TIA, -- Guilherme Machado Cirne gci...@gmail.com On Mon, Mar 16, 2009 at 8:00 AM, Yun Huang Yong wrote: > Hi, > > I'm using Log4r and one of its neat features is its handling of blocks such > that you can do: > log.debug { "Something b

Re: [rspec-users] Are there any example specs for content importers to learn from

2009-03-21 Thread Pat Maddox
That's basically what I do. http://gist.github.com/82981 shows one I wrote a couple days ago. I yield each object because there are like 400k records and I can't keep them in memory. Might be a little nicer to yield the params hash and let the caller build the object, but I don't need that flexi

Re: [rspec-users] Problem spec'ing ActionMailer with attachment, body not getting rendered.

2009-03-21 Thread Rick DeNatale
On Fri, Mar 20, 2009 at 11:46 AM, Zach Dennis wrote: > On Fri, Mar 20, 2009 at 11:11 AM, Zach Dennis > wrote: > > 2009/3/18 Rick DeNatale : > >> I've got a simple ActionMailer::Base subclass: > >> class InfoMailer < ActionMailer::Base > >> > >> def info(user, zip_name) > >> recipients us

Re: [rspec-users] Mocking base class methods

2009-03-21 Thread Jeroen van Dijk
> > describe "count_by_params" do > > it "should pass all the params and options to #scope_by_params" do > > params = { :foo => 1, :bar => 2 } > > options = { :foo => 3, :bar => 4 } > > > > @base = ActiveRecord::Base > > @result = mock("query results", :count => 1) >

[rspec-users] Are there any example specs for content importers to learn from

2009-03-21 Thread Chris Adams
Hi guys, This is my first post to the mailing list, so apologies if this kind of question comes up alot already. I've been working through the Peepcode screencasts on RSpec, and I'm trying to what I've been learning into practice to make an importer on a rails app that takes an xml feed,

Re: [rspec-users] [Cucumber] Rails Upgrade Notes

2009-03-21 Thread aslak hellesoy
On Sat, Mar 21, 2009 at 12:53 PM, s.ross wrote: > In the history.txt for 0.2 is an "important note" toward the bottom of the > announcement. ( > http://github.com/aslakhellesoy/cucumber/blob/d0555e4ca8a133f020efefd5a755da04bde3f57d/History.txt). > This is really, *really* important for Rails user

[rspec-users] [Cucumber] Rails Upgrade Notes

2009-03-21 Thread s.ross
In the history.txt for 0.2 is an "important note" toward the bottom of the announcement. (http://github.com/aslakhellesoy/cucumber/blob/d0555e4ca8a133f020efefd5a755da04bde3f57d/History.txt ). This is really, *really* important for Rails users, but it can be more than a bit difficult to Google

Re: [rspec-users] [cucumber] Sinatra "polyglot" app path error

2009-03-21 Thread aslak hellesoy
On Fri, Mar 20, 2009 at 9:36 AM, beenimble wrote: > In case of the following error when using Cucumber with Sinatra: > > No such file or directory - /usr/local/lib/ruby/gems/1.8/gems/ > polyglot-0.2.4/lib/views/index.erb > > Implement env.rb as specified at the following link so your app and > it

Re: [rspec-users] OT: SIT - how to turn it off

2009-03-21 Thread James Byrne
James Byrne wrote: > In this particular case this was a has_many / belongs_to pair and I was > attempting a parent.child.create({}) call. S/B: parent.children.create({}) -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-use

Re: [rspec-users] OT: SIT - how to turn it off

2009-03-21 Thread James Byrne
David Chelimsky wrote: > > What type of association? There are many and they are all handled > quite differently. > In this particular case this was a has_many / belongs_to pair and I was attempting a parent.child.create({}) call. I discovered thereby that Rails, at least in version 2.3.2, e

Re: [rspec-users] New User Issues

2009-03-21 Thread David Chelimsky
2009/3/20 Scott LaBounty : > I just found RSpec and was trying to do the example on the main page for > RSpec (the bowling example). I'm using Ubuntu and did the normal "sudo gem > install rspec" and then tried to create the bowling_spec.rb file. When I ran > spec bowling_spec.rb, I was missing the

[rspec-users] New User Issues

2009-03-21 Thread Scott LaBounty
I just found RSpec and was trying to do the example on the main page for RSpec (the bowling example). I'm using Ubuntu and did the normal "sudo gem install rspec" and then tried to create the bowling_spec.rb file. When I ran spec bowling_spec.rb, I was missing the cucumber gem, installed that, rera

[rspec-users] [cucumber] Sinatra "polyglot" app path error

2009-03-21 Thread beenimble
In case of the following error when using Cucumber with Sinatra: No such file or directory - /usr/local/lib/ruby/gems/1.8/gems/ polyglot-0.2.4/lib/views/index.erb Implement env.rb as specified at the following link so your app and its view path may be found (this supersedes prior examples): http

Re: [rspec-users] OT: SIT - how to turn it off

2009-03-21 Thread David Chelimsky
On Fri, Mar 20, 2009 at 3:32 PM, James Byrne wrote: > Pardon the intrusion but if somebody knows how to turn off Rails special > treatment of attributes ending in _type and _value I would dearly like > to have this information. > > Workarounds are accepted too. > > I am trying to initialise an ass

Re: [rspec-users] [cucumber] getting scenario name in hook

2009-03-21 Thread Nigel Thorne
That is exactly what I was looking for.. Thank you ! 2009/3/21 Tim Walker : > We're accessing it like this > > Before do |scenario| >  puts "Before Scenario: #{scenario.to_sexp[3]}" >  . >  . >  . >  end > > HTH, > > Tim > > On Thu, Mar 19, 2009 at 9:39 PM, Nigel Thorne wrote: >> >> Where