Sha256: 220a9d34b35900a8930267b08eee0a145208e754378528c2af91a2f3119f5b57
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
require 'spec_helper' describe 'ChiliGenerator' do describe 'rails g chili EXTENSION_NAME' do let(:app_path) { File.expand_path("../../../dummy/example", __FILE__) } let(:template_path) { File.expand_path("../../../dummy/blank_extension", __FILE__) } before do FileUtils.rm_rf File.join(app_path, 'vendor/chili/blank_extension') FileUtils.rm_rf File.join(app_path, 'Gemfile') FileUtils.touch File.join(app_path, 'Gemfile') end it 'creates a new extension with a correct file structure' do puts `cd #{app_path} && rails g chili:extension blank` Dir.glob(File.join(template_path, "**/*")).reject { |f| File.directory?(f) }.each do |template| result = File.join(app_path, 'vendor/chili/blank_extension', template.sub(template_path, '')) result_text = File.open(result, 'rb').read template_text = File.open(template, 'rb').read template_text.sub!('GIT_AUTHOR',`git config user.name`.chomp) # Git author is different on each machine template_text.sub!('GIT_EMAIL',`git config user.email`.chomp) # Git email is different on each machine result_text.should == template_text end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
chili-0.3.3 | spec/generators/chili/chili_generator_spec.rb |
chili-0.3.2 | spec/generators/chili/chili_generator_spec.rb |