Permalink
Browse files

clean up test_config

  • Loading branch information...
1 parent 07b3d8f commit 4956554c9266eef81b19db390062bb6cff8d2fc0 @achiu achiu committed Jul 23, 2010
Showing with 7 additions and 16 deletions.
  1. +7 −16 test/test_config.rb
View
@@ -14,24 +14,14 @@ class Riot::Situation
# The Rack app under test.
def app
- defined?(@app) ? @app : build_app
+ IdeaGrid.tap { |app| }
end
- private
-
- def build_app
- config_file = File.read(find_config_file)
- Rack::Builder.new { instance_eval(config_file) }.to_app
- end
-
- def find_config_file
- if Dir.glob("config.ru").length > 0
- File.join(Dir.pwd,"config.ru")
- elsif Dir.pwd != "/"
- Dir.chdir("..") { find_config_file }
- else
- raise "Cannot find config.ru"
- end
+ def mock_model(&block)
+ mock = Class.new
+ mock.class_eval { include MongoMapper::Document }
+ mock.class_eval(&block)
+ mock
end
end
@@ -46,5 +36,6 @@ class Riot::Context
def app(app=nil, &block)
setup { @app = (app || block) }
end
+
end

0 comments on commit 4956554

Please sign in to comment.