Sha256: 4fda77c524e3eba0c15d9823fe999706f941d91f5d25de709a09aecda222fc87

Contents?: true

Size: 473 Bytes

Versions: 51

Compression:

Stored size: 473 Bytes

Contents

require 'delorean_lang'

module Marty; module RSpec;
  class Helper
    include Delorean::Model
    # Helper function which increments a global counter.  Can be used by
    # tests which run Delorean code to see how many times some code is
    # being called.  Works for rule scripts as well.
    delorean_fn :global_inc, sig: 1 do |inc|
      @@global_inc ||= 0

      if inc
        @@global_inc += inc
      else
        @@global_inc = 0
      end
    end
  end
end end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
marty-2.6.4 spec/support/helper.rb
marty-2.6.3 spec/support/helper.rb
marty-2.6.2 spec/support/helper.rb
marty-2.6.1 spec/support/helper.rb
marty-2.6.0 spec/support/helper.rb
marty-2.5.9 spec/support/helper.rb
marty-2.5.8 spec/support/helper.rb
marty-2.5.7 spec/support/helper.rb
marty-2.5.6 spec/support/helper.rb
marty-2.5.5 spec/support/helper.rb
marty-2.5.4 spec/support/helper.rb