test/helper.rb in padrino-gen-0.10.2 vs test/helper.rb in padrino-gen-0.10.3

- old
+ new

@@ -1,22 +1,20 @@ require File.expand_path('../../../load_paths', __FILE__) -require 'test/unit' +require File.join(File.dirname(__FILE__), '..', '..', 'padrino-core', 'test', 'mini_shoulda') require 'rack/test' require 'rack' require 'uuid' -require 'shoulda' -require 'mocha' require 'webrat' require 'grit' require 'thor/group' require 'fakeweb' require 'padrino-gen' require 'padrino-core/support_lite' unless defined?(SupportLite) Padrino::Generators.load_components! -class Test::Unit::TestCase +class MiniTest::Spec include Rack::Test::Methods include Webrat::Methods include Webrat::Matchers Webrat.configure do |config| @@ -106,14 +104,10 @@ include_text = " register #{name.to_s.camelize}Initializer\n" Thor::Actions::InjectIntoFile.expects(:new).with(anything,anything, include_text, anything).returns(instance) Thor::Actions::CreateFile.expects(:new).with(anything, path, kind_of(Proc), anything).returns(instance) end - def expects - - end - # expects_rake "custom" def expects_rake(command,options={}) #options.reverse_merge!(:root => '/tmp') Padrino.expects(:bin).with("rake", command, "-c=#{options[:root]}").returns(true) end @@ -129,21 +123,9 @@ ::Grit::Repo.stubs(:new).with(options[:root]).returns(base) ::Grit::Git.any_instance.expects(command.to_sym).with(options[:arguments]).returns(true) end end -end - -class Object - # Silences the output by redirecting to stringIO - # silence_logger { ...commands... } => "...output..." - def silence_logger(&block) - orig_stdout = $stdout - $stdout = log_buffer = StringIO.new - block.call - $stdout = orig_stdout - log_buffer.rewind && log_buffer.read - end end module Webrat module Logging def logger # # @private