Class: MimiCheck::Checker

Inherits:
Object
  • Object
show all
Extended by:
TailCallOptimization
Defined in:
lib/mimicheck/checker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TailCallOptimization

tail_recursive

Instance Attribute Details

#examplesObject (readonly)

Returns the value of attribute examples.



5
6
7
# File 'lib/mimicheck/checker.rb', line 5

def examples
  @examples
end

#generatorsObject (readonly)

Returns the value of attribute generators.



5
6
7
# File 'lib/mimicheck/checker.rb', line 5

def generators
  @generators
end

#propertyObject (readonly)

Returns the value of attribute property.



5
6
7
# File 'lib/mimicheck/checker.rb', line 5

def property
  @property
end

#trialsObject (readonly)

Returns the value of attribute trials.



5
6
7
# File 'lib/mimicheck/checker.rb', line 5

def trials
  @trials
end

Class Method Details

.for(proc, &blk) ⇒ Object



7
8
9
# File 'lib/mimicheck/checker.rb', line 7

def self.for(proc, &blk)
  new(proc || blk).with
end

Instance Method Details

#check(gens = nil) ⇒ Object



19
20
21
# File 'lib/mimicheck/checker.rb', line 19

def check(gens = nil)
  check! Array(gens || generators)
end

#check_examples(exs = nil) ⇒ Object



23
24
25
# File 'lib/mimicheck/checker.rb', line 23

def check_examples(exs = nil)
  check_examples! Array(exs || examples)
end

#with(trials: nil, generators: nil, examples: nil) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/mimicheck/checker.rb', line 11

def with(trials: nil, generators: nil, examples: nil)
  tap do
    @trials = trials if trials
    @generators = generators if generators
    @examples = examples if examples
  end
end