Class: Oktobertest::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/oktobertest.rb

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, &block) ⇒ Scope

Returns a new instance of Scope.



50
51
52
53
# File 'lib/oktobertest.rb', line 50

def initialize(name = nil, &block)
  @name, @block = name.to_s, block
  @setup, @teardown = [], []
end

Instance Method Details

#runObject



55
56
57
# File 'lib/oktobertest.rb', line 55

def run
  instance_eval &@block
end

#run?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/oktobertest.rb', line 59

def run?
  !ENV['S'] || ENV['S'] == @name
end