Skip to content

Commit

Permalink
added fix to riot/rr generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
achiurizo committed Feb 12, 2010
1 parent b2b99b2 commit 12e6b03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -2,15 +2,19 @@ module Padrino
module Generators
module Components
module Mocks

module RrGen
def setup_mock
require_dependencies 'rr', :group => 'test'
insert_mocking_include "RR::Adapters::RRMethods", :path => "test/test_config.rb"
if options[:test] == 'riot'
inject_into_file "test/test_config.rb"," Riot.rr\n", :after => "class Riot::Situation\n"
else
insert_mocking_include "RR::Adapters::RRMethods", :path => "test/test_config.rb"
end
end
end

end
end
end
end
end
2 changes: 1 addition & 1 deletion padrino-gen/test/test_app_generator.rb
Expand Up @@ -81,7 +81,7 @@ def setup
buffer = silence_logger { @app.start(['sample_app', '--root=/tmp', '--mock=rr', '--script=none']) }
assert_match /Applying.*?rr.*?mock/, buffer
assert_match_in_file(/gem 'rr'/, '/tmp/sample_app/Gemfile')
assert_match_in_file(/include RR::Adapters::RRMethods/m, '/tmp/sample_app/test/test_config.rb')
assert_match_in_file(/Riot.rr/m, '/tmp/sample_app/test/test_config.rb')
end

should "properly generate default for mocha" do
Expand Down

0 comments on commit 12e6b03

Please sign in to comment.