Class: RSpec::Core::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/queencheck/rspec/dsl.rb

Class Method Summary collapse

Class Method Details

.qcheck(instance, method, arbitraries, options = {}, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/queencheck/rspec/dsl.rb', line 6

def self.qcheck(instance, method, arbitraries, options = {}, &block)
  describe "QC: #{instance.class}##{method}(#{arbitraries.join(', ')})" do
    QueenCheck(instance, method, *arbitraries).run(options) do | result, args, error |
      it("Gen: #{args.join(', ')}"){ 
        begin
          self.instance_eval_with_args(*[result, args, error], &block)
        rescue => e
          e.set_backtrace(e.backtrace.slice(0,6) + e.backtrace.slice(9, 100))
          raise e
        end
      }
    end
  end
end