Sha256: 9c2325e87669abe681d3825dc62e46f4edeeb2dbd1650e40e892ea3a5939cea4

Contents?: true

Size: 970 Bytes

Versions: 6

Compression:

Stored size: 970 Bytes

Contents

require 'teststrap'

context "A not! assertion macro" do
  helper(:assert_not!) { |o| Riot::Assertion.new("foo") { o }.not! }

  assertion_test_passes("when value is false", "does exist ... not!") { assert_not!(false) }
  assertion_test_passes("when value is nil", "does exist ... not!")   { assert_not!(nil)   }
  assertion_test_fails("when value is not nil or false", "expected to exist ... not!") do
    assert_not!("funny")
  end
end # A not! assertion macro

context "A negative not! assertion macro" do
  helper(:assert_not_not!) { |o| Riot::Assertion.new("foo", true) { o }.not! }
  
  assertion_test_fails("when value is false", "expected to not exist ... not!") { assert_not_not!(false)   }
  assertion_test_fails("when value is nil", "expected to not exist ... not!")   { assert_not_not!(nil)     }
  assertion_test_passes("when value is not nil or false", "does not exist ... not!") do 
    assert_not_not!('borat')
  end
end # A negative not! assertion macro

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
riot-0.12.4 test/core/assertion_macros/not_borat_test.rb
riot-0.12.3 test/core/assertion_macros/not_borat_test.rb
riot-0.12.2 test/core/assertion_macros/not_borat_test.rb
riot-0.12.1 test/core/assertion_macros/not_borat_test.rb
riot-0.12.0 test/core/assertion_macros/not_borat_test.rb
riot-0.12.0.pre test/core/assertion_macros/not_borat_test.rb