Re: [rspec-users] slightly confusing error message

2011-08-23 Thread David Chelimsky
On Aug 23, 2011, at 3:26 PM, Rob Biedenharn wrote: > On Aug 23, 2011, at 3:16 PM, David Chelimsky wrote: > >> On Aug 23, 2011, at 1:00 PM, Roger Pack wrote: >> >>> This error message: >>> >>> >>> it 'should' do >>>proc { eval("a=")}.should raise_exception(/SyntaxError/) >>> end > > shoul

Re: [rspec-users] slightly confusing error message

2011-08-23 Thread Rob Biedenharn
On Aug 23, 2011, at 3:16 PM, David Chelimsky wrote: On Aug 23, 2011, at 1:00 PM, Roger Pack wrote: This error message: it 'should' do proc { eval("a=")}.should raise_exception(/SyntaxError/) end shouldn't that be raise_exception(SyntaxError) that is, the exception class, not

Re: [rspec-users] [JRuby] simulating a java exception in a spec

2011-08-23 Thread Lenny Marks
> > On Aug 22, 2011, at 5:50 PM, Lenny Marks wrote: > >> JRuby 1.6.2 >> rspec-core (2.6.4) >> rspec-expectations (2.6.0) >> rspec-mocks (2.6.0) >> rspec-rails (2.6.1) >> >> I'm sure this has more to do with the way JRuby wraps Java exceptions but I >> figured I'd post here in case anyone here h

Re: [rspec-users] slightly confusing error message

2011-08-23 Thread David Chelimsky
On Aug 23, 2011, at 1:00 PM, Roger Pack wrote: > This error message: > > > it 'should' do > proc { eval("a=")}.should raise_exception(/SyntaxError/) > end > > > expected Exception with message matching /SyntaxError/, got > # > > Is a bit confusing, since it appears from the err

[rspec-users] slightly confusing error message

2011-08-23 Thread Roger Pack
This error message: it 'should' do proc { eval("a=")}.should raise_exception(/SyntaxError/) end expected Exception with message matching /SyntaxError/, got # Is a bit confusing, since it appears from the error output that it *does* match /SyntaxError/ Might be able to word

Re: [rspec-users] [JRuby] simulating a java exception in a spec

2011-08-23 Thread Sidu Ponnappa
Please ignore my previous question - I just realised you're doing Java::java.lang.NullPointerException.new in your second example. I'm seeing the same behaviour and can't think of any way around it off the top of my head. You could try redefining Java::JavaLang::NullPointerException to be a Ruby R

Re: [rspec-users] pretty inspect for diff?

2011-08-23 Thread David Chelimsky
On Aug 23, 2011, at 12:47 PM, Roger Pack wrote: > Hello. > > I noticed this test "failed" message: > > https://gist.github.com/1165975 > > The salient part is this diff: > > Diff: > > @@ -1,4 +1,4 @@ > -{"blank_outs"=>[["0:00:56.0", "0:00:57.0"], ["0:01:05", > "0:01:14.500"]

Re: [rspec-users] ruby 1.8.6

2011-08-23 Thread Roger Pack
> It's growing increasingly difficult for RSpec to support Ruby 1.8.6 as > other libraries that rspec's development environment relies on drop > support. Noting that 1.8.7 was released over three years ago (6/1/2008), > I'd like to drop support for Ruby 1.8.6 for future versions of RSpec, > but I'd

[rspec-users] pretty inspect for diff?

2011-08-23 Thread Roger Pack
Hello. I noticed this test "failed" message: https://gist.github.com/1165975 The salient part is this diff: Diff: @@ -1,4 +1,4 @@ -{"blank_outs"=>[["0:00:56.0", "0:00:57.0"], ["0:01:05", "0:01:14.500"]], +{"imdb_id"=>"tt1727587", "mutes"=>[], - "imdb

Re: [rspec-users] Rails validation spec fails (but code works in development env)

2011-08-23 Thread Vito Botta
Hi there, di you ever find the answer? I am having the same issue now, really weird. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [JRuby] simulating a java exception in a spec

2011-08-23 Thread Sidu Ponnappa
it 'adds validation exceptions raised by service to #errors' do ve = ValidationException #a java exception ve.stub(:localized_message).and_return('a bunch of errors') Just clarifying, but did you mean ve = ValidationException.new I tried replicating your spec but with jav

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Justin Ko
On Tue, Aug 23, 2011 at 6:22 AM, Gordon Yeong wrote: > I found out why it was not working. > > The line, 'Part.should_receive(:update_attributes).with('title' => 'Brake > pads').and_return(part)' should not be there because the controller specs > should not care about implementation (ie. how thin

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Justin Ko
On Tue, Aug 23, 2011 at 6:11 AM, Gordon Yeong wrote: > >> Do you have a before filter somewhere that is preventing the >> :update_attributes message from being received? >> >> I have checked my application's controllers > (app/controllers/application_controller.rb and > app/controllers/parts_co

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Ken Chien
I think you were closer when you had: --- Source code extract starts - context 'saves updates to an existing part object successfully' do before do part = double('part').stub(:update_ attributes).and_return(true) end it 'does its job in saving

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread David Chelimsky
On Aug 23, 2011, at 7:22 AM, Gordon Yeong wrote: > I found out why it was not working. > > The line, 'Part.should_receive(:update_attributes).with('title' => 'Brake > pads').and_return(part)' should not be there because the controller specs > should not care about implementation (ie. how things

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Gordon Yeong
> > > Do you have a before filter somewhere that is preventing the > :update_attributes message from being received? > > I have checked my application's controllers (app/controllers/application_controller.rb and app/controllers/parts_controller.rb) and controller spec (spec/controllers/parts_cont

Re: [rspec-users] Cucumber: Running a single feature / scenario

2011-08-23 Thread Justin Ko
Sent from my iPhone On Aug 22, 2011, at 11:25 PM, "Nishith R." wrote: > For sake of completeness, if you are using bundle in rails3, and don't > want to invoke rake [to save init time], you can also execute it the > following way: > > bundle exec cucumber --guess --profile default > path/f

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Gordon Yeong
I found out why it was not working. The line, 'Part.should_receive(:update_attributes).with('title' => 'Brake pads').and_return(part)' should not be there because the controller specs should not care about implementation (ie. how things are processed, rather just what is done). I realised this wh

Re: [rspec-users] Route is valid but not found :(

2011-08-23 Thread Justin Ko
Sent from my iPhone On Aug 22, 2011, at 10:14 PM, ct9a wrote: > > > On Aug 23, 1:55 pm, Justin Ko wrote: >> On Mon, Aug 22, 2011 at 9:09 PM, ct9a wrote: >> >>> Thanks, Justin. >> >>> I have the part object mocked up before each spec runs. >> >>> --- Extract begins -