diff --git a/.gitignore b/.gitignore index b7f53088f..62e7c9013 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .rvmrc Gemfile.lock spec/database.yml +tmp \ No newline at end of file diff --git a/acts-as-taggable-on.gemspec b/acts-as-taggable-on.gemspec index 1acb829db..9536d45a1 100644 --- a/acts-as-taggable-on.gemspec +++ b/acts-as-taggable-on.gemspec @@ -12,6 +12,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'rails' gem.add_development_dependency 'rspec', '~> 2.5' + gem.add_development_dependency 'ammeter', '~> 0.1.3' gem.add_development_dependency 'sqlite3' gem.add_development_dependency 'mysql2', '< 0.3' gem.add_development_dependency 'pg' diff --git a/spec/generators/acts_as_taggable_on/migration/migration_generator_spec.rb b/spec/generators/acts_as_taggable_on/migration/migration_generator_spec.rb new file mode 100644 index 000000000..32f012c3c --- /dev/null +++ b/spec/generators/acts_as_taggable_on/migration/migration_generator_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +# Generators are not automatically loaded by Rails +require 'generators/acts_as_taggable_on/migration/migration_generator' + +describe ActsAsTaggableOn::MigrationGenerator do + # Tell the generator where to put its output (what it thinks of as Rails.root) + destination File.expand_path("../../../../../tmp", __FILE__) + + before do + prepare_destination + Rails::Generators.options[:rails][:orm] = :active_record + end + describe 'no arguments' do + before { run_generator } + + describe 'db/migrate/acts_as_taggable_on_migration.rb' do + subject { file('db/migrate/acts_as_taggable_on_migration.rb') } + it { should be_a_migration } + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d4a1e463f..1b51560d5 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,6 +19,7 @@ Bundler.require require File.expand_path('../../lib/acts-as-taggable-on', __FILE__) +require 'ammeter/init' unless [].respond_to?(:freq) class Array