[rspec-users] rspec - undefined method `describe' for main:Object

Mano ah lists at ruby-forum.com
Fri Oct 10 02:56:53 EDT 2008



When i run a spec file i am getting the following error

  D:\Diwakar\spec_diwa\spec\controllers>spec sandbox_controller_spec.rb
c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/lib/spec/api/sugar.rb:17:in
`method_
missing': undefined method `describe' for main:Object (NoMethodError)
        from ./sandbox_controller_spec.rb:7
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in `ge
m_original_require'
        from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in `re
quire'
        from c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/bin/spec:13
        from c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/bin/spec:7:in
`each'
        from c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/bin/spec:7
        from c:/ruby/bin/spec:19:in `load'
        from c:/ruby/bin/spec:19



My spec controller is

require File.dirname(__FILE__) + '/../spec_helper'
#require './../../vendor/generators/rspec/lib/rspec_on_rails'
#require 'sandbox_controller.rb'
require 'spec'
gem 'rspec'

describe SandboxController,"handling someaction" do

  it "should get real value 10" do

    get :someaction

    assigns[:value].should equal(10)

  end

end



My controller is



class SandboxController < ApplicationController

  def someaction

    @value = somemethod

  end


  protected


  def somemethod

    return 10

  end

end

Please help me to solve the issue
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list