Class: GeneratorSpec::Matcher::Migration

Inherits:
File
  • Object
show all
Defined in:
lib/generator_spec/matcher.rb

Instance Method Summary collapse

Methods inherited from File

#contains, #does_not_contain, #initialize

Constructor Details

This class inherits a constructor from GeneratorSpec::Matcher::File

Instance Method Details

#descriptionObject



58
59
60
# File 'lib/generator_spec/matcher.rb', line 58

def description
  'valid migration file'
end

#matches?(root) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
65
66
67
68
69
70
# File 'lib/generator_spec/matcher.rb', line 62

def matches?(root)
  file_name = migration_file_name(root, @name)

  unless file_name && file_name.exist?
    throw :failure, @name
  end

  check_contents(file_name)
end