Class: Test::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/obsidian/rails/model_update_tracker.rb

Instance Method Summary collapse

Instance Method Details

#assert_models_created(*models, &blk) ⇒ Object



150
151
152
153
154
# File 'lib/obsidian/rails/model_update_tracker.rb', line 150

def assert_models_created(*models, &blk)
  Obsidian::Rails::ModelUpdateTracker.reset
  blk.call
  assert_equal(Set.new(models.map(&:to_s)), Obsidian::Rails::ModelUpdateTracker.created_delta.class_names)
end

#assert_models_destroyed(*models, &blk) ⇒ Object



138
139
140
141
142
# File 'lib/obsidian/rails/model_update_tracker.rb', line 138

def assert_models_destroyed(*models, &blk)
  Obsidian::Rails::ModelUpdateTracker.reset
  blk.call
  assert_equal(Set.new(models.map(&:to_s)), Obsidian::Rails::ModelUpdateTracker.destroyed_delta.class_names)
end

#assert_models_updated(*models, &blk) ⇒ Object



144
145
146
147
148
# File 'lib/obsidian/rails/model_update_tracker.rb', line 144

def assert_models_updated(*models, &blk)
  Obsidian::Rails::ModelUpdateTracker.reset
  blk.call
  assert_equal(Set.new(models.map(&:to_s)), Obsidian::Rails::ModelUpdateTracker.updated_delta.class_names)
end

#assert_no_models_created(&blk) ⇒ Object



126
127
128
# File 'lib/obsidian/rails/model_update_tracker.rb', line 126

def assert_no_models_created(&blk)
  assert_models_created(&blk)
end

#assert_no_models_destroyed(&blk) ⇒ Object



130
131
132
# File 'lib/obsidian/rails/model_update_tracker.rb', line 130

def assert_no_models_destroyed(&blk)
  assert_models_destroyed(&blk)
end

#assert_no_models_updated(&blk) ⇒ Object



134
135
136
# File 'lib/obsidian/rails/model_update_tracker.rb', line 134

def assert_no_models_updated(&blk)
  assert_models_updated(&blk)
end