Class: NilClass

Inherits:
Object show all
Defined in:
lib/spectre/assertion.rb

Instance Method Summary collapse

Instance Method Details

#should_be(val) ⇒ Object

Raises:

  • (AssertionFailure)


48
49
50
# File 'lib/spectre/assertion.rb', line 48

def should_be(val)
  raise AssertionFailure.new("Value is empty, but it should be '#{val.to_s.trim}'", val, nil) unless val == nil
end

#should_be_emptyObject



52
53
# File 'lib/spectre/assertion.rb', line 52

def should_be_empty
end

#should_not_be(val) ⇒ Object

Raises:

  • (AssertionFailure)


55
56
57
# File 'lib/spectre/assertion.rb', line 55

def should_not_be(val)
  raise AssertionFailure.new(val, 'nil') unless val != nil
end

#should_not_be_emptyObject

Raises:

  • (AssertionFailure)


62
63
64
# File 'lib/spectre/assertion.rb', line 62

def should_not_be_empty
  raise AssertionFailure.new('Value is empty', 'nil')
end

#should_not_existObject



59
60
# File 'lib/spectre/assertion.rb', line 59

def should_not_exist
end