Module: Test::Spec::Rails::ShouldNotExpectations

Includes:
Assertions
Defined in:
lib/test/spec/rails/expectations.rb

Instance Method Summary collapse

Instance Method Details

#differ(*args) ⇒ Object Also known as: change

Tests that the evaluation of the expression shouldn’t change

lambda { Norm.new }.should.not.differ(‘Norm.count’)



84
85
86
# File 'lib/test/spec/rails/expectations.rb', line 84

def differ(*args)
  assert_no_difference(*args, &@object)
end

#dom_equal(expected) ⇒ Object

Test that two HTML strings are not equivalent



90
91
92
# File 'lib/test/spec/rails/expectations.rb', line 90

def dom_equal(expected)
  assert_dom_not_equal expected, @object
end

#validateObject

Test that an object is not valid



77
78
79
# File 'lib/test/spec/rails/expectations.rb', line 77

def validate
  assert !@object.valid?
end