Class: RSpec::FileMatchers::GenerateMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_for_generators/matchers/file/generate_migration.rb

Instance Method Summary collapse

Constructor Details

#initialize(relative) ⇒ GenerateMigration

Returns a new instance of GenerateMigration.



12
13
14
# File 'lib/rspec_for_generators/matchers/file/generate_migration.rb', line 12

def initialize(relative)
  @relative = relative      
end

Instance Method Details

#failure_messageObject



20
21
22
# File 'lib/rspec_for_generators/matchers/file/generate_migration.rb', line 20

def failure_message
  "Expected migration #{relative} to have been generated, but it was not"
end

#matches?(generator) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rspec_for_generators/matchers/file/generate_migration.rb', line 16

def matches?(generator)      
  migration_file_name(relative, generator)        
end

#negative_failure_messageObject



24
25
26
# File 'lib/rspec_for_generators/matchers/file/generate_migration.rb', line 24

def negative_failure_message
  "Did not expect migration #{relative} to have been generated, but it was"
end