test/test_hoe.rb in hoe-2.12.5 vs test/test_hoe.rb in hoe-2.13.0

- old
+ new

@@ -49,20 +49,26 @@ ENV['HOME'] = path $LOAD_PATH << path Dir.mkdir File.join(path, 'hoe') open File.join(path, 'hoe', 'hoerc.rb'), 'w' do |io| - io.write 'module Hoe::Hoerc; def initialize_hoerc; end; end' + io.write <<-EOM + module Hoe::Hoerc + def initialize_hoerc; end + def define_hoerc_tasks; end + end + EOM end open File.join(path, '.hoerc'), 'w' do |io| io.write YAML.dump('plugins' => %w[hoerc]) end methods = hoe.methods.grep(/^initialize/).map { |s| s.to_s } assert_includes methods, 'initialize_hoerc' + assert_includes Hoe.plugins, :hoerc end ensure Hoe.instance_variable_get(:@loaded).delete :hoerc Hoe.plugins.delete :hoerc Hoe.send :remove_const, :Hoerc @@ -108,19 +114,25 @@ ENV['HOME'] = path $LOAD_PATH << path Dir.mkdir File.join(path, 'hoe') open File.join(path, 'hoe', 'hoerc.rb'), 'w' do |io| - io.write 'module Hoe::Hoerc; def initialize_hoerc; @hoerc_plugin_initialized = true; end; end' + io.write <<-EOM + module Hoe::Hoerc + def initialize_hoerc; @hoerc_plugin_initialized = true; end + def define_hoerc_tasks; end + end + EOM end open File.join(path, '.hoerc'), 'w' do |io| io.write YAML.dump('plugins' => %w[hoerc]) end methods = hoe.instance_variables.map(&:to_s) assert_includes(methods, '@hoerc_plugin_initialized', "Hoerc plugin wasn't initialized") + assert_includes Hoe.plugins, :hoerc end ensure Hoe.instance_variable_get(:@loaded).delete :hoerc Hoe.plugins.delete :hoerc Hoe.send :remove_const, :Hoerc