conz
November 5, 2009, 12:05am
1
Hi, ‘rake spec’ failed to run on Ruby 1.9.1p243 and RSpec 1.2.9. I’m
getting the following error message when I run the specs:
/opt/local/lib/ruby/gems/1.9.1/gems/rspec-1.2.9/spec/spec/runner/
option_parser_spec.rb:21:in `block (2 levels) in <top (required)>’:
wrong number of arguments (0 for 1) (ArgumentError)
After analyzing the error message, it appears that “use_fakefs” method
on lines 21 and 522 of the
option_parser_spec.rb
should take an argument.
-Conrad
conz
November 5, 2009, 12:45am
2
On Tue, Nov 3, 2009 at 7:25 AM, Conrad T. [email protected]
wrote:
Hi, ‘rake spec’ failed to run on Ruby 1.9.1p243 and RSpec 1.2.9.
Hi Conrad,
If this was a problem in the gem, it is now fixed:
$ rvm 1.9.1
$ which ruby
/Users/david/.rvm/ruby-1.9.1-p243/bin/ruby
$ rake spec
…
1522 examples, 0 failures, 2 pending
Cheers,
David
conz
November 8, 2009, 1:51pm
3
David, I’m still seeing the issue. Thus, here’s a transcript of my
activity:
http://pastie.org/688639
-Conrad
conz
November 8, 2009, 4:32pm
4
On Sun, Nov 8, 2009 at 2:35 AM, Conrad T. [email protected]
wrote:
David, I’m still seeing the issue. Thus, here’s a transcript of my
activity:
http://pastie.org/688639
$ gem which fakefs
(checking gem bmabey-fakefs-0.1.1.1 for fakefs)
/Users/david/.rvm/gems/ruby/1.9.1/gems/bmabey-fakefs-0.1.1.1/lib/fakefs.rb
What version of fakefs are you using?
conz
November 24, 2009, 3:47am
5
On Fri, Nov 20, 2009 at 9:06 PM, Bogdan D. [email protected]
wrote:
use_fakefs describe “smth” do … end
As it seems the use_fakefs method now takes the describe block as a
parameter and thus the error regarding the wrong number of parameters.
I had to do this slightly differently, but got it to work with
fakefs-0.2.1.
Fixed in git.
Cheers,
David
conz
November 21, 2009, 9:58am
6
The syntax for use_fakefs changed in version 0.2.1 and the fixtures
for rspec are generating errors, but it can be solved easily.
Have to change …
describe “smth” do
extend FakeFS::SpecHelpers
use_fakefs
…
end
To…
extend FakeFS::SpecHelpers
use_fakefs describe “smth” do … end
As it seems the use_fakefs method now takes the describe block as a
parameter and thus the error regarding the wrong number of parameters.
conz
November 24, 2009, 5:14am
7
On Mon, Nov 23, 2009 at 9:36 PM, Scott T. [email protected]
wrote:
use_fakefs
I had to do this slightly differently, but got it to work with
example_group.use_fakefs(example_group)
end
def self.included(example_group)
example_group.extend self
end
…
end
That’s exactly what I did
committed 11:43PM - 23 Nov 09 UTC
Cheers,
David
conz
November 24, 2009, 5:13am
8
On Nov 23, 2009, at 9:35 PM, David C. wrote:
extend FakeFS::SpecHelpers
use_fakefs describe “smth” do … end
As it seems the use_fakefs method now takes the describe block as a
parameter and thus the error regarding the wrong number of parameters.
I had to do this slightly differently, but got it to work with fakefs-0.2.1. Fixed in git.
Cheers,
David
You can use include, too:
module SpecHelpers
def self.extended(example_group)
example_group.use_fakefs(example_group)
end
def self.included(example_group)
example_group.extend self
end
…
end
Scott
conz
November 24, 2009, 5:43am
9
On Nov 23, 2009, at 11:12 PM, David C. wrote:
describe “smth” do
end
def self.included(example_group)
example_group.extend self
end
…
end
That’s exactly what I did
switch to fakefs · dchelimsky/rspec@65485d8 · GitHub
Hadn’t realized the docs were wrong in the README. Now they are
updated:
committed 04:34AM - 24 Nov 09 UTC
Thanks for the heads up.
Scott