<commit_before>require File.dirname(__FILE__) + '/generator_test_init'

class HelperGeneratorTest < GeneratorTestCase
  def setup
    super
    cp_r File.join(PLUGIN_ROOT, 'generators/helper'),  File.join(RAILS_ROOT, 'vendor/generators')
  end
  
  context 'using generator with no params' do
    setup do
      # run_generator('helper', %w(Tags))
    end
  end
  
end<commit_msg>Create tests for helper generator<commit_after>require File.dirname(__FILE__) + '/generator_test_init'

class HelperGeneratorTest < GeneratorTestCase
  def setup
    super
    cp_r File.join(PLUGIN_ROOT, 'generators/helper'),  File.join(RAILS_ROOT, 'vendor/generators')
  end
  
  context 'running generator with simple name' do
    setup do
      run_generator('helper', %w(Tags))
    end
    
    should 'create helper' do
      assert_generated_helper_for :tags
    end
    
    should 'create helper tests' do
      assert_generated_class 'test/helpers/tags_helper_test', 'ActionView::TestCase'
    end
  end
  
  context 'running generator with complex name' do
    setup do
      run_generator('helper' %w(Admin::Tags))
    end
    
    should 'create helper' do
      assert_generated_helper_for 'Admin::Tags'
    end
    
    should 'create helper tests' do
      assert_generated_class 'test/helpers/admin/tags_helper_test', 'ActionView::TestCase'
    end
  end
  
  context 'running generator with method names' do
    setup do
      run_generator('helper' %w(Tags format sort to_html))
    end
    
    should 'create helper with methods' do
      assert_generated_helper_for :tags do |helper|
        assert_has_method helper, :format, :sort, :to_html
      end
    end
    
    should 'create helper tests with methods' do
      assert_generated_class 'test/helpers/tags_helper_test', 'ActionView::TestCase' do |test|
        assert_has_method test, :test_format, :test_sort, :test_to_html
      end
    end
  end
  
end
{'fraction_non_alphanumeric': 0.08102456874019864, 'fraction_numerical': 0.0, 'mean_word_length': 3.330316742081448, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691935', 'n_tokens_mistral': 582, 'n_tokens_neox': 584, 'n_words': 158}