Sha256: 5ec3f62a8eeba77d77e234199b81848bd5e890b3c15483b79bbd6af4fd672fce

Contents?: true

Size: 601 Bytes

Versions: 1

Compression:

Stored size: 601 Bytes

Contents

class DriverFactory

  attr_reader :drivers_count

  def initialize(log_path)
    @log = File.open(log_path, 'w')
    @drivers = []
  end

  def get_driver(app)
    @log.puts "Driver created"
    driver = TestDriver.new(app)
    @drivers << driver
    driver
  end

  def drivers_clean?
    @drivers.all?(&:clean?)
  end

  def drivers_count
    @drivers.size
  end

  class TestDriver

    def initialize(app)
      @app   = app
      @clean = true
    end

    def visit(path)
      @clean = false
    end

    def reset!
      @clean = true
    end

    def clean?
      @clean
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bbq-0.1.0 test/support/driver_factory.rb