Sha256: 85fcc926e5387395d7a1bf2ee0c1be17f8a5c196f033fe79921e7a30f5a233c6

Contents?: true

Size: 1.16 KB

Versions: 11

Compression:

Stored size: 1.16 KB

Contents

# Auto-generated by Remi.
# Add user-customizations to env_app.rb

require 'bundler/setup'
require 'remi'
require 'remi/cucumber'

Remi::Settings.log_level = Logger::ERROR
Remi::Settings.jobs_dir = File.join(__dir__, '../../jobs')

Before do
  # Restart the random number generator prior to each scenario to
  # ensure we have reproducibility of random output
  Kernel.srand(35983958269835333)

  # Monkey patch faker gem so that dummy random dates and ranges are generated consistently
  class Faker::Base
    def self.rand_in_range(from, to)
      from, to = to, from if to < from
      Random.rand(from..to)
    end
  end
end

After do
  Kernel.srand
end


Before '~@fails' do
  def expect_cucumber(&block)
    block.call
  end
end

Before '@fails' do
  def expect_cucumber(&block)
    begin
      block.call
    rescue RSpec::Expectations::ExpectationNotMetError => err
      puts "Expected error: #{err}"
    end
  end
end


# Fix current time to the first time it is called in a test
module TimeTesting
  def current
    @current_time ||= super
  end
end

class Time
  class << Time
    prepend TimeTesting
  end
end

# Include user-defined environment
require_relative 'env_app.rb'

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
remi-0.3.3 features/support/env.rb
remi-0.3.2 features/support/env.rb
remi-0.3.1 features/support/env.rb
remi-0.3.0 features/support/env.rb
remi-0.2.42 features/support/env.rb
remi-0.2.41 features/support/env.rb
remi-0.2.40 features/support/env.rb
remi-0.2.39 features/support/env.rb
remi-0.2.38 features/support/env.rb
remi-0.2.37 features/support/env.rb
remi-0.2.36 features/support/env.rb