Sha256: 1035aa115a6870c0c5e91daf6aae4df992ba3f59a1b415cb988c95fdf0a073a7

Contents?: true

Size: 971 Bytes

Versions: 4

Compression:

Stored size: 971 Bytes

Contents

require 'spec_helper'

RSpec::Generator.debug = true

require_generators :all

describe 'helper_generator' do  
  use_helper :helper
  
  before :each do              
    setup_generator 'helper_generator' do
      tests HelperGenerator
    end    
    remove_helper :account    
  end

  after :each do              
    remove_helper :account    
  end
    
  it "should not work without an Account helper file" do            
    with_generator do |g|
      g.run_generator :account.args
      g.should_not generate_helper :account
    end
  end

  it "should decorate an existing Account helper file with a 'help_me' method" do
    with_generator do |g|  
      create_helper :account do
        '# helper content'
      end    
      g.run_generator :account.args
      g.should generate_helper :account do |content|
        content.should have_helper_class :account do |klass|
          klass.should have_method :help_me
        end
      end
    end
  end
end



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
generator-spec-0.6.6 spec/generator_spec/generators/helper_gen_spec.rb
generator-spec-0.6.5 spec/generator_spec/generators/helper_gen_spec.rb
generator-spec-0.6.4 spec/generator_spec/generators/helper_gen_spec.rb
generator-spec-0.6.3 spec/generator_spec/generators/helper_gen_spec.rb