test/helper.rb in padrino-gen-0.13.1 vs test/helper.rb in padrino-gen-0.13.2

- old
+ new

@@ -12,10 +12,23 @@ require 'ext/minitest-spec' Padrino::Generators.load_components! +# register fake URL to avoid downloading static files every time tests run +fake_uri_base = "https://raw.github.com/padrino/padrino-static/master/" +%W[ + js/dojo.js ujs/dojo.js + js/ext.js ujs/ext.js + js/jquery.js ujs/jquery.js + js/mootools.js ujs/mootools.js + js/right.js ujs/right.js + js/protopak.js js/lowpro.js ujs/prototype.js +].each do |suffix| + FakeWeb.register_uri(:get, fake_uri_base + suffix, :body => '') +end + class MiniTest::Spec include Webrat::Methods include Webrat::Matchers Webrat.configure do |config| @@ -77,10 +90,10 @@ end # expects_initializer :test, "# Example" def expects_initializer(name, body,options={}) #options.reverse_merge!(:root => "/tmp/sample_project") - path = File.join(options[:root],'lib',"#{name}_initializer.rb") + path = File.join(options[:root],'config/initializers',"#{name}.rb") instance = mock instance.expects(:invoke!).at_least_once 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)