Created
April 22, 2009 10:54
-
-
Save tomtt/99717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Foo | |
| class Bar | |
| include ActionController::UrlWriter | |
| def self.some_path | |
| puts root_path | |
| end | |
| end | |
| end | |
| require File.expand_path(File.dirname(__FILE__) + '/../spec/spec_helper') | |
| describe Foo::Bar do | |
| it "should be able to use url writer" do | |
| Foo::Bar.some_path.should == '/' | |
| end | |
| end | |
| ## Running spec from command line: | |
| >: spec lib/test.rb | |
| F | |
| 1) | |
| NameError in 'Foo::Bar should be able to use url writer' | |
| undefined local variable or method `root_path' for Foo::Bar:Class | |
| ./lib/test.rb:6:in `some_path' | |
| ./lib/test.rb:14: | |
| script/spec:10: | |
| Finished in 0.083218 seconds | |
| 1 example, 1 failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment