Sha256: 87e3c7d499b40cf2783acea53ad02cad3f43d2de21768d4959ff9cebdb2af44f

Contents?: true

Size: 534 Bytes

Versions: 15

Compression:

Stored size: 534 Bytes

Contents

module Auger
  
  class Test
    attr_accessor :name, :block, :id

    def initialize(name, block)
      @name = name
      @block = block
    end
    
    ## return Auger::Result object with outcome of test
    def run(response)
      outcome =
        if response.is_a?(Exception) or @block.nil?
          response
        else
          @block.call(response) rescue $! # run the test
        end

      result = outcome.is_a?(Result) ? outcome : Auger::Result.new(outcome)
      result.test = self
      result
    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
auger-1.4.5 lib/auger/test.rb
auger-1.4.4 lib/auger/test.rb
auger-1.4.3 lib/auger/test.rb
auger-1.4.2 lib/auger/test.rb
auger-1.4.1 lib/auger/test.rb
auger-1.4.0 lib/auger/test.rb
auger-1.3.8 lib/auger/test.rb
auger-1.3.7 lib/auger/test.rb
auger-1.3.6 lib/auger/test.rb
auger-1.3.5 lib/auger/test.rb
auger-1.3.4 lib/auger/test.rb
auger-1.3.3 lib/auger/test.rb
auger-1.3.2 lib/auger/test.rb
auger-1.3.1 lib/auger/test.rb
auger-1.3.0 lib/auger/test.rb