Module: RSpec::RubyContent::Helpers

Defined in:
lib/rspec_for_generators/matchers/helpers/content.rb,
lib/rspec_for_generators/matchers/helpers/migration.rb

Instance Method Summary collapse

Instance Method Details

#check_add_column(name, type = 'string') ⇒ Object Also known as: adds_column



49
50
51
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 49

def check_add_column name, type='string'
  self.should add_column name, type, &block
end

#check_add_tbl_column(tbl_name, name, type = 'string') ⇒ Object Also known as: adds_tbl_column



59
60
61
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 59

def check_add_tbl_column tbl_name, name, type='string'
  self.should add_tbl_column tbl_name, name, type
end

#check_add_tbl_index(tbl_name, name) ⇒ Object Also known as: adds_tbl_index



79
80
81
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 79

def check_add_tbl_index tbl_name, name
  self.should add_tbl_index tbl_name, name
end

#check_change_column(name, type = 'string') ⇒ Object Also known as: changes_column



54
55
56
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 54

def check_change_column name, type='string'
  self.should change_column name, type, &block
end

#check_change_table(name, &block) ⇒ Object Also known as: changes_table



29
30
31
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 29

def check_change_table name, &block
  self.should change_table name, &block
end

#check_change_tbl_column(tbl_name, name, type = 'string') ⇒ Object Also known as: changes_tbl_column



64
65
66
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 64

def check_change_tbl_column tbl_name, name, type='string'
  self.should change_tbl_column tbl_name, name, type
end

#check_create_table(name, &block) ⇒ Object Also known as: creates_table



24
25
26
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 24

def check_create_table name, &block
  self.should create_table name, &block
end

#check_down(&block) ⇒ Object Also known as: down



19
20
21
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 19

def check_down &block
  self.should have_down, &block 
end

#check_drop_table(name) ⇒ Object Also known as: drops_table



34
35
36
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 34

def check_drop_table name
  self.should drop_table name, &block
end

#check_matchings(matchings) ⇒ Object Also known as: matchings



3
4
5
6
7
# File 'lib/rspec_for_generators/matchers/helpers/content.rb', line 3

def check_matchings matchings
  matchings.each do |matching|
    self.should match /#{Regexp.escape(matching)}/
  end
end

#check_methods(methods, type = nil) ⇒ Object Also known as: methods



11
12
13
14
15
# File 'lib/rspec_for_generators/matchers/helpers/content.rb', line 11

def check_methods methods, type=nil
  methods.each do |method_name|
    self.should have_method(method_name, type)
  end
end

#check_remove_column(name) ⇒ Object Also known as: removes_column



44
45
46
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 44

def check_remove_column name
  self.should remove_colum name, &block
end

#check_remove_tbl_column(tbl_name, name) ⇒ Object Also known as: removes_tbl_column



74
75
76
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 74

def check_remove_tbl_column tbl_name, name
  self.should remove_tbl_column tbl_name, name
end

#check_remove_tbl_index(tbl_name, name) ⇒ Object Also known as: removes_tbl_index



84
85
86
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 84

def check_remove_tbl_index tbl_name, name
  self.should remove_tbl_index tbl_name, name
end

#check_rename_table(name) ⇒ Object Also known as: renames_table



39
40
41
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 39

def check_rename_table name
  self.should rename_table name, &block
end

#check_rename_tbl_column(tbl_name, new_name) ⇒ Object Also known as: renames_tbl_column



69
70
71
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 69

def check_rename_tbl_column tbl_name, new_name
  self.should rename_tbl_column tbl_name, new_name
end

#check_up(&block) ⇒ Object Also known as: up



14
15
16
# File 'lib/rspec_for_generators/matchers/helpers/migration.rb', line 14

def check_up &block
  self.should have_up, &block
end