Sha256: c14942121b8808e1dd0b69d2f9fe221887c4d71dc7bf0b0006dc33b7dcc86326

Contents?: true

Size: 785 Bytes

Versions: 1

Compression:

Stored size: 785 Bytes

Contents

require "konacha/engine"
require "konacha/runner"
require "konacha/server"

module Konacha
  class << self
    attr_accessor :mode

    def serve
      puts "Your tests are here:"
      puts "  http://localhost:#{port}/"
      self.mode = :server
      Konacha::Server.start
    end

    def run
      self.mode = :runner
      Konacha::Runner.start
    end

    def config
      Konacha::Engine.config.konacha
    end

    def configure
      yield config
    end

    delegate :port, :spec_dir, :application, :driver, :to => :config

    def spec_root
      File.join(Rails.root, config.spec_dir)
    end

    def spec_paths
      Dir[File.join(spec_root, "**{,/*/**}/*{_spec,_test}.*")].uniq.map do |path|
        path.gsub(File.join(spec_root, ''), '')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
konacha-1.3.1 lib/konacha.rb