Sha256: 31ec2f939bcf1eec424439c9b181a0ea534745915e9ba043eb8024df7123c661
Contents?: true
Size: 1.23 KB
Versions: 21
Compression:
Stored size: 1.23 KB
Contents
require 'assert' require 'ardb/runner/generate_command' class Ardb::Runner::GenerateCommand class BaseTests < Assert::Context desc "Ardb::Runner::GenerateCommand" setup do @cmd = Ardb::Runner::GenerateCommand.new(['something']) end subject{ @cmd } should have_instance_methods :run, :migration_cmd end class MigrationTests < BaseTests desc "Ardb::Runner::GenerateCommand::MigrationCommand" setup do @cmd = Ardb::Runner::GenerateCommand::MigrationCommand.new('a_migration') end should have_readers :identifier, :class_name, :file_name, :template should "know its given identifier" do assert_equal 'a_migration', subject.identifier end should "know its class name" do assert_equal "AMigrations", subject.class_name end should "know its file name" do assert_match /.+_a_migration$/, subject.file_name end should "know its template" do assert_includes "require 'ardb/migration_helpers'", subject.template assert_includes "class #{subject.class_name} < ActiveRecord::Migration", subject.template assert_includes "include Ardb::MigrationHelpers", subject.template assert_includes "def change", subject.template end end end
Version data entries
21 entries across 21 versions & 1 rubygems