[rspec-users] Error Running Standalone/Command Line rspec: undefined method Pathname

David Chelimsky dchelimsky at gmail.com
Sat Dec 12 13:29:40 EST 2009


On Sat, Dec 12, 2009 at 11:28 AM, athem <allan.m.miller at gmail.com> wrote:
> Hello,
>
> I've written the following simple rspec test that I'm trying to run
> (rspec 1.2.9) standalone (outside Rails) from the command line and
> getting the following error.  Any idea for how to fix this?  Thanks.
>
> $>  spec foo_rspec.rb
>
> /Users/athem/.gem/ruby/1.8/gems/rspec-1.2.9/lib/spec/runner/options.rb:
> 108:in `determine_project_root': undefined method `Pathname' for
> #<Spec::Runner::Options:0x14dc1e4> (NoMethodError).

There is a require 'pathname' statement in the method in options.rb
that calls determine_project_root. Please try adding that to the
beginning of your spec file and see if it works. If so, we'll need to
investigate more to find out why it doesn't work for you as/is when it
works for everyone else.

HTH,
David

>
> foo_rspec.rb file:
>
>
> require 'spec_helper'
>
> class Foo
> end
>
> describe "A Foo that says boo" do
>  before(:each) do
>    @foo = Foo.new
>  end
>
>  it "should say boo" do
>    @foo.should say_boo
>  end
> end
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list