Sha256: 6a703b71cc1d3189bfae963e62e1668046586a7bce5bbb9629912a38578bb9a1

Contents?: true

Size: 753 Bytes

Versions: 3

Compression:

Stored size: 753 Bytes

Contents

module Cypress
  class Configuration
    attr_accessor :test_framework, :db_resetter, :cache_classes, :server_port

    def initialize(args=[])
      setup(args)
    end

    def setup(args)
      @args           = args
      @test_framework = :rspec
      @db_resetter    = :database_cleaner
      @before         = proc {}
      @cache_classes  = run_mode == 'run'
    end

    def include(mod)
      ScenarioContext.send :include, mod
    end

    def before(&block)
      if block_given?
        @before = block
      else
        @before
      end
    end

    def run_mode
      if @args.first == 'run'
        'run'
      else
        'open'
      end
    end

    def load_support
      require "./spec/cypress/cypress_helper"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cypress-on-rails-0.2.2 lib/cypress/configuration.rb
cypress-on-rails-0.2.1 lib/cypress/configuration.rb
cypress-on-rails-0.2.0 lib/cypress/configuration.rb