0.0
Low commit activity in last 3 years
No release in over a year
Traces the methods used for each use case and returns them as raw Polyrex documents
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.3, >= 1.3.6
~> 0.1, >= 0.1.5
~> 0.4, >= 0.4.0
 Project Readme

Introducing the usecase_tracer gem

require 'usecase_tracer'


class Light

  def on()
    puts 'light is on'
  end

  def off()
    puts 'light is off'
  end
end

class LiveblogTracer < UsecaseTracer

  class_tracer :Light

  def cases()

    usecase 'switching the light on' do

      trace do

        light = Light.new
        light.on

      end

      true
    end

    usecase 'switching the light off' do

      trace do

        light = Light.new
        light.off

      end

      true
    end

    usecase 'switching the light on and off' do

      trace do

        light = Light.new
        light.on
        sleep 2
        light.off

      end

      true
    end

  end

end
  
lt = LiveblogTracer.new
lt.run

lt.testresult #=> [[0, true], [1, true], [2, true]] 
lt.passed? #=> true 
lt.tracelog

Tracelog output

<?polyrex schema='session[title,tags]/entry[classname, methodname]' delimiter='#'?>
title: switching the light on
tags: trace Light

Light#on
<?polyrex schema='session[title,tags]/entry[classname, methodname]' delimiter='#'?>
title: switching the light off
tags: trace Light

Light#off
<?polyrex schema='session[title,tags]/entry[classname, methodname]' delimiter='#'?>
title: switching the light on and off
tags: trace Light

Light#on
Light#off

Resources

usecase trace gem usecasetracer tracer