[rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread grail
"Partial Commits" are not needed to share code. That is why you use branches in Subversion: to provide a place for people working on a common development thread to put their work when it isn't ready for trunk. You still stick to "only commit when green". No broken code goes into the repository. B

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread Stephen Eley
On Thu, Aug 20, 2009 at 8:00 PM, Marcelo de Moraes Serpa wrote: > > However, a co-worker of mine came to me and said that partial commits > are needed to share code. I don't agree with that, I think we can use > patches or branches to do that (like a development branch) but at > least one branch sh

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread Ben Mabey
David Chelimsky wrote: On Thu, Aug 20, 2009 at 7:00 PM, Marcelo de Moraes Serpa wrote: Hello list, I'm working in a big project in the company I'm working on as a "BDD tech lead", this means I'm leading the implementation of BDD in ongoing projects, most of them did not use BDD from the star

Re: [rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread David Chelimsky
On Thu, Aug 20, 2009 at 7:00 PM, Marcelo de Moraes Serpa wrote: > Hello list, > > I'm working in a big project in the company I'm working on as a "BDD > tech lead", this means I'm leading the implementation of BDD in > ongoing projects, most of them did not use BDD from the start. > > I implemented

[rspec-users] Sharing code and still keeping a "only commit if all is green" discipline

2009-08-20 Thread Marcelo de Moraes Serpa
Hello list, I'm working in a big project in the company I'm working on as a "BDD tech lead", this means I'm leading the implementation of BDD in ongoing projects, most of them did not use BDD from the start. I implemented the policy of "Only commit if all your tests are passing", this in all test

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread Maurício Linhares
Yes, so it's useless trying to stub it. Tools like Remarkable will let you spec that validates call in a better way -> http://github.com/carlosbrando/remarkable/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 20, 2009 at 6:07 PM, BallaBall wrot

Re: [rspec-users] [Rails] How to mock/stub link_to from a Rails helper spec?

2009-08-20 Thread Mike Sassak
On Thu, Aug 20, 2009 at 3:00 PM, Ed Ruder wrote: > All, > > In a Rails helper spec, how do I stub or mock the 'link_to' method? > When i step into link_to, self.class is > > Spec::Rails::Example::HelperExampleGroup::Subclass_1::Subclass_5::Subclass_1. > > What I'm trying to do is stub link_to and

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread BallaBall
Ohhh so when the model is first loaded it has already run the method im trying to stub? On Aug 20, 2:00 pm, Maurício Linhares wrote: > When you spec runs (and your stub! is called) the method has already > been called, so your stub will never catch anything. > > - > Maurício > Linhareshttp://cod

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread Maurício Linhares
When you spec runs (and your stub! is called) the method has already been called, so your stub will never catch anything. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Thu, Aug 20, 2009 at 5:03 PM, BallaBall wrote: > I have some model with the followin

[rspec-users] RSpec stub/mock I18n

2009-08-20 Thread BallaBall
I have some model with the following validation: validates_inclusion_of :value, :in => I18n.available_locales.map(&:to_s) I would think that I would be able to stub out that method in a test like so: it "should accepted any available locale as a value" do I18n.stub!(:available_locales

Re: [rspec-users] Change in -l command line option when line number is inside a describe block?

2009-08-20 Thread Ed Ruder
I lied--I'm running 1.2.7, but I'm happy that this was fixed in 1.2.8! Thanks, David. Ed On Aug 20, 12:28 pm, David Chelimsky wrote: > On Thu, Aug 20, 2009 at 2:16 PM, Ed Ruder wrote: > > All, > > > I often run specs from inside of TextMate, using the RSpec bundle. > > When the selection is ins

Re: [rspec-users] Change in -l command line option when line number is inside a describe block?

2009-08-20 Thread David Chelimsky
On Thu, Aug 20, 2009 at 2:16 PM, Ed Ruder wrote: > All, > > I often run specs from inside of TextMate, using the RSpec bundle. > When the selection is inside of an example, I can run just that > example using the RSpec bundle's "Run Single Example" script, which I > assume ends up calling spec with

[rspec-users] Change in -l command line option when line number is inside a describe block?

2009-08-20 Thread Ed Ruder
All, I often run specs from inside of TextMate, using the RSpec bundle. When the selection is inside of an example, I can run just that example using the RSpec bundle's "Run Single Example" script, which I assume ends up calling spec with a -l command line option ("line number"). Until a few vers

[rspec-users] [Rails] How to mock/stub link_to from a Rails helper spec?

2009-08-20 Thread Ed Ruder
All, In a Rails helper spec, how do I stub or mock the 'link_to' method? When i step into link_to, self.class is Spec::Rails::Example::HelperExampleGroup::Subclass_1::Subclass_5::Subclass_1. What I'm trying to do is stub link_to and check that its parameters are correct--i.e., that a helper metho

[rspec-users] Workaround for spec_server "can't dup NilClass"

2009-08-20 Thread Dave Nolan
On recent versions of RSpec/RSpec rails, if you are using Machinist/Factory_Girl or similar, you may get "can't dup NilClass" errors running specs through spec_server. (Not on the initial run, but on all subsequent runs.) The workaround is to manually re-load the factories/templates each spec run

Re: [rspec-users] Match a regex with Cucumber + Webrat

2009-08-20 Thread Tom Stuart
On 20 Aug 2009, at 17:37, Davide Benini wrote: Then /^I should see a flash player with "([^\"]*)"$/ do |arg1| response.should have_selector('param', :name => 'FlashVars') do | param| param.should =~ /.+#{Regexp.escape("numero-1")}.+/m end end I have been tweaking the regex a bit (eliminat

[rspec-users] Match a regex with Cucumber + Webrat

2009-08-20 Thread Davide Benini
Hello folks, I am trying to learn Cucumber and testing in general. I am working on a app fo lingustic studies, but for the purpose of testing it can be compared to a "guess the song" app. When a new quiz is take, a page shows a number of flash players, each one with a single track. The app works, b