Forum: RSpec --options file quirky with --drb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Higgaion (Guest)
on 2009-03-05 21:03
(Received via mailing list)
putting --drb in my spec.opts file has some unexpected results.

$ spec --drb --colour --format specdoc --loadby mtime --reverse -G
spec/spec.opts
$ spec spec/models/a_model_spec.rb -O spec/spec.opts
$

it just returns right away, with no output.


but...
$ spec --colour --format specdoc --loadby mtime --reverse -G spec/
spec.opts
$ spec spec/models/campaign_spec.rb -O spec/spec.opts
:
:
lots of pretty spec output
:
:
$

interestingly, if i include a spec file in the call that generates the
options file, like
$ spec spec/models/campaign_spec.rb --drb --colour --format specdoc --
loadby mtime --reverse -G spec/spec.opts
then running those options like this works as expected, even with --
drb.
$ spec spec/models/a_model_spec.rb -O spec/spec.opts

of course, that isn't a very useful way to use rspec, and its
incompatible with my rspec holy grail dreams:
http://wiki.github.com/dchelimsky/rspec/spec_serve...

it seems that this would be a problem with options file loading, no?
anyone else able to reproduce this issue?
David C. (Guest)
on 2009-03-05 21:13
(Received via mailing list)
On Thu, Mar 5, 2009 at 12:32 PM, Higgaion <removed_email_address@domain.invalid>
wrote:
> putting --drb in my spec.opts file has some unexpected results.
>
> $ spec --drb --colour --format specdoc --loadby mtime --reverse -G
> spec/spec.opts
> $ spec spec/models/a_model_spec.rb -O spec/spec.opts
> $
>
> it just returns right away, with no output.

What version of rspec are you running? This should be fixed in git.

>
> interestingly, if i include a spec file in the call that generates the
> options file, like
> $ spec spec/models/campaign_spec.rb --drb --colour --format specdoc --
> loadby mtime --reverse -G spec/spec.opts
> then running those options like this works as expected, even with --
> drb.
> $ spec spec/models/a_model_spec.rb -O spec/spec.opts

Never heard that before :) - obviously not intended.
Higgaion (Guest)
on 2009-03-05 23:39
(Received via mailing list)
On Mar 5, 1:09 pm, David C. <removed_email_address@domain.invalid> wrote:
> What version of rspec are you running? This should be fixed in git.
>

rspec 1.1.12.

i installed the plugins from git, as per the instructions here:
http://wiki.github.com/dchelimsky/rspec/rails
and it worked beautifully, as in spec_server and autospec talking
together*

one issue: now all of my route generation specs that illustrate
differentiation on http method are failing. ex:

Test::Unit::AssertionFailedError in 'UsersController route generation
should route users's 'update' action correctly'
The recognized options <{"action"=>"show", "id"=>"1",
"controller"=>"users"}> did not match <{"action"=>"update", "id"=>"1",
"controller"=>"users"}>, difference: <{"action"=>"update"}>

here it thought put was get.

i guess that's why its the edge version :)



* with one minor change:

vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb
-          DRb.start_service("druby://localhost:0")
+          DRb.start_service("druby://127.0.0.1:0")

i always have to change that because i build ruby from macports.
David C. (Guest)
on 2009-03-06 00:06
(Received via mailing list)
On Thu, Mar 5, 2009 at 3:18 PM, Higgaion <removed_email_address@domain.invalid>
wrote:
>>
>> What version of rspec are you running? This should be fixed in git.
>>
>
> rspec 1.1.12.
>
> i installed the plugins from git, as per the instructions here:
> http://wiki.github.com/dchelimsky/rspec/rails
> and it worked beautifully, as in spec_server and autospec talking
> together*

Great.

> here it thought put was get.
>
> i guess that's why its the edge version :)

This is doc'd here:
http://github.com/dchelimsky/rspec-rails/blob/mast...

> * with one minor change:
>
> vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb
> -          DRb.start_service("druby://localhost:0")
> +          DRb.start_service("druby://127.0.0.1:0")
>
> i always have to change that because i build ruby from macports.

Maybe we need to make that configurable.

Thanks,
David
Higgaion (Guest)
on 2009-03-06 00:22
(Received via mailing list)
On Mar 5, 3:18 pm, Higgaion <removed_email_address@domain.invalid> wrote:
> > > it just returns right away, with no output.
> differentiation on http method are failing. ex:
>
ok, i read some code and i see that rspec is now using
assert_recognizes, which expects a :method option. so if i change

route_for(:controller => 'users', :action => 'update', :id =>
'1').should == "/users/1"

to

route_for(:controller => 'users', :action => 'update', :id =>
'1').should == { :path => "/users/1", :method => :put }

the assertion passes (and is a little more descriptive).
This topic is locked and can not be replied to.