Class: Whitestone::Assertion::True

Inherits:
Base show all
Defined in:
lib/whitestone/assertion_classes.rb

Overview

———————————————————————– #

Direct Known Subclasses

False

Instance Method Summary collapse

Methods inherited from Base

#block

Methods included from Guards

#args_or_block_one_only, #block_required, #no_block_allowed, #one_argument, #two_arguments, #two_or_three_arguments, #type_check

Constructor Details

#initialize(mode, *args, &block) ⇒ True

Returns a new instance of True.



135
136
137
138
# File 'lib/whitestone/assertion_classes.rb', line 135

def initialize(mode, *args, &block)
  super
  @test_lambda = args_or_block_one_only(args, block)
end

Instance Method Details

#messageObject



142
143
144
# File 'lib/whitestone/assertion_classes.rb', line 142

def message
  Col["Assertion failed"].yb
end

#runObject



139
140
141
# File 'lib/whitestone/assertion_classes.rb', line 139

def run
  @test_lambda.call ? true : false
end