Sha256: 1bd8a1ab50bd080421d0e381b3835d0bec6acd733635dc2bba84ba1078a65337

Contents?: true

Size: 419 Bytes

Versions: 28

Compression:

Stored size: 419 Bytes

Contents

# more helpers
class Object

  # ex: assert(some statement)
  # or
  # assert(some statement, "some helper string")
  def assert(should_be_true, string = nil)
    if(!should_be_true)
      raise "assertion failed #{string}"
    end
  end unless respond_to? :assert
  
  def refute(this_boolean, string = nil)
    assert(!this_boolean, string)
  end
  alias :y! :assert
  alias :yes! :assert
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
sane-0.25.8 lib/sane/test/assertions.rb
sane-0.25.7 lib/sane/test/assertions.rb
sane-0.25.6 lib/sane/test/assertions.rb
sane-0.25.5 lib/sane/test/assertions.rb
sane-0.25.4 lib/sane/test/assertions.rb
sane-0.25.3 lib/sane/test/assertions.rb
sane-0.25.2 lib/sane/test/assertions.rb
sane-0.25.1 lib/sane/test/assertions.rb
sane-0.25.0 lib/sane/test/assertions.rb
sane-0.24.6 lib/sane/test/assertions.rb
sane-0.24.5 lib/sane/test/assertions.rb
sane-0.24.4 lib/sane/test/assertions.rb
sane-0.24.3 lib/sane/test/assertions.rb
sane-0.23.6 lib/sane/test/assertions.rb
sane-0.24.2 lib/sane/test/assertions.rb
sane-0.24.1 lib/sane/test/assertions.rb
sane-0.24.0 lib/sane/test/assertions.rb
sane-0.23.5 lib/sane/test/assertions.rb
sane-0.23.4 lib/sane/test/assertions.rb
sane-0.23.3 lib/sane/test/assertions.rb