Class: Defekt::Base
Class Method Summary
collapse
Methods included from Assertions
#equal_to!, #identical_to!, #included_in!, #instance_of!, #kind_of!, #nil!, #not_equal_to!, #not_identical_to!, #not_included_in!, #not_instance_of!, #not_kind_of!, #not_nil!, #not_respond_to!, #not_true!, #respond_to!, #true!, #verify!
Class Method Details
.after(&block) ⇒ Object
9
10
11
|
# File 'lib/defekt/base.rb', line 9
def self.after(&block)
define_method(:after, &block)
end
|
.before(&block) ⇒ Object
5
6
7
|
# File 'lib/defekt/base.rb', line 5
def self.before(&block)
define_method(:before, &block)
end
|
18
19
20
|
# File 'lib/defekt/base.rb', line 18
def self.children
@children ||= []
end
|
.descendants ⇒ Object
22
23
24
|
# File 'lib/defekt/base.rb', line 22
def self.descendants
children + children.flat_map(&:descendants)
end
|
.test(name, &block) ⇒ Object
13
14
15
16
|
# File 'lib/defekt/base.rb', line 13
def self.test(name, &block)
safe_name = "test_#{name.gsub(/\s+/, '_')}".to_sym
define_method(safe_name, &block)
end
|