Sha256: ac363374f00d62fde753de765d52593cf218737a8dcee31d36a5719e939becad

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

require "active_support/test_case"

class ActiveSupport::TestCase
  def fetch_inventory
    get "/cogy/inventory"
    YAML.load(response.body)
  end

  def with_config(opts={})
    old = {}

    opts.each do |k, v|
      old[k] = Cogy.send(k)
      Cogy.send("#{k}=", v)
    end

    yield fetch_inventory

    old.each do |k, v|
      Cogy.send("#{k}=", v)
    end
  end

  def without_commands
    old = Cogy.commands
    Cogy.commands = {}
    yield
    Cogy.commands = old
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cogy-0.3.0 test/support/helpers.rb
cogy-0.2.1 test/support/helpers.rb
cogy-0.2.0 test/support/helpers.rb
cogy-0.1.1 test/support/helpers.rb