Skip to content

Commit

Permalink
added specs for the migration_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrothenberg committed Oct 10, 2011
1 parent dcc0c62 commit fd63eda
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
.rvmrc
Gemfile.lock
spec/database.yml
tmp
1 change: 1 addition & 0 deletions acts-as-taggable-on.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd63eda

Please sign in to comment.