Sha256: 3344ae28202f1687513f395b8e3487ad3b34333bc6fbb19a5c8d6e1a371e34e7

Contents?: true

Size: 439 Bytes

Versions: 11

Compression:

Stored size: 439 Bytes

Contents

def assert_changed(expression, &block)
  if expression.respond_to?(:call)
    e = expression
  else
    e = lambda{ eval(expression, block.binding) }
  end
  old = e.call
  block.call
  assert_not_equal old, e.call
end

def assert_not_changed(expression, &block)
  if expression.respond_to?(:call)
    e = expression
  else
    e = lambda{ eval(expression, block.binding) }
  end
  old = e.call
  block.call
  assert_equal old, e.call
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
axlsx_styler-1.0.0 test/custom_assertions.rb
spreadsheet_architect-3.3.1 test/custom_assertions.rb
spreadsheet_architect-3.3.0 test/custom_assertions.rb
sexy_form-0.9.0 spec/custom_assertions.rb
spreadsheet_architect-3.2.1 test/custom_assertions.rb
spreadsheet_architect-3.2.0 test/custom_assertions.rb
spreadsheet_architect-3.1.0 test/custom_assertions.rb
spreadsheet_architect-3.0.0 test/custom_assertions.rb
spreadsheet_architect-2.1.2 test/custom_assertions.rb
spreadsheet_architect-2.1.1 test/custom_assertions.rb
spreadsheet_architect-2.1.0 test/custom_assertions.rb