class Glimmer::Specification::Element::Fact

Attributes

fact_block_in_progress[RW]

Public Class Methods

new(parent, keyword, *args, &block) click to toggle source
Calls superclass method Glimmer::Specification::Element::new
# File lib/glimmer/specification/element/fact.rb, line 30
def initialize(parent, keyword, *args, &block)
  @executable = true
  super
  source_code = PutsDebuggerer::SourceFile.new(@block.source_location.first).source(1, @block.source_location.last)
  @title = source_code.strip
end

Public Instance Methods

run() click to toggle source
# File lib/glimmer/specification/element/fact.rb, line 37
def run
  Fact.fact_block_in_progress = true
  @verified = @block.call
  Fact.fact_block_in_progress = false
  if @verified
    puts Colours::GREEN + "VERIFIED: #{to_s}"
  else
    puts Colours::RED + "NOT VERIFIED: #{to_s}"
  end
end