Module: MimiCheck::RSpecHelper

Defined in:
lib/mimicheck/rspec_helper.rb

Instance Method Summary collapse

Instance Method Details

#check(prop, gens = nil) ⇒ Object



3
4
5
6
7
8
# File 'lib/mimicheck/rspec_helper.rb', line 3

def check(prop, gens = nil)
  gens = Array(gens || generators)

  result = checker_for(prop).check(gens)
  expect(result).to eq(MimiCheck::Result::Success.new(prop))
end

#check_with_examples(prop, exs = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/mimicheck/rspec_helper.rb', line 10

def check_with_examples(prop, exs = nil)
  exs = Array(exs || examples)

  result = checker_for(prop).check_examples(exs)
  expect(result).to eq(MimiCheck::Result::Success.new(prop))
end

#examplesObject



21
22
23
# File 'lib/mimicheck/rspec_helper.rb', line 21

def examples
  fail 'You must define a list of examples with let(:examples) { ... }'
end

#generatorsObject



17
18
19
# File 'lib/mimicheck/rspec_helper.rb', line 17

def generators
  fail 'You must define a list of generators with let(:generators) { ... }'
end

#trialsObject



25
26
27
# File 'lib/mimicheck/rspec_helper.rb', line 25

def trials
  MimiCheck.trials
end