class Kontrast::Test

Attributes

headers[R]
name[R]
path[R]
prefix[R]
spec[R]

Public Class Methods

new(prefix, name, path, headers: {}) click to toggle source
# File lib/kontrast/test.rb, line 5
def initialize(prefix, name, path, headers: {})
    @prefix, @name, @path, @headers = prefix, name, path, headers
end

Public Instance Methods

bind_spec(spec) click to toggle source
# File lib/kontrast/test.rb, line 9
def bind_spec(spec)
    @spec = spec
end
run_callback(name, *args) click to toggle source

Usage: test.run_callback(:before_screenshot, arg1, arg2, arg3)

# File lib/kontrast/test.rb, line 14
def run_callback(name, *args)
    return if @spec.nil?
    @spec.send(name.to_sym, *args)
end
to_s() click to toggle source
# File lib/kontrast/test.rb, line 19
def to_s
    return "#{@prefix}_#{@name}"
end
to_str() click to toggle source
# File lib/kontrast/test.rb, line 23
def to_str
    return to_s
end