File: rspec.rb

package info (click to toggle)
ruby-flores 0.0.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 244 kB
  • sloc: ruby: 952; makefile: 36
file content (33 lines) | stat: -rw-r--r-- 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# encoding: utf-8
# This file is part of ruby-flores.
# Copyright (C) 2015 Jordan Sissel
# 
# :nodoc:
require "flores/namespace"

# The root of the rspec helpers the Flores library provides
module Flores::RSpec
  DEFAULT_ITERATIONS = 1..1000

  # Sets up rspec with the Flores RSpec helpers. Usage looks like this:
  #
  #     RSpec.configure do |config|
  #       Flores::RSpec.configure(config)
  #     end
  def self.configure(rspec_configuration)
    require "flores/rspec/stress"
    require "flores/rspec/analyze"
    rspec_configuration.extend(Flores::RSpec::Stress)
    rspec_configuration.extend(Flores::RSpec::Analyze)
  end # def self.configure

  def self.iterations
    return @iterations if @iterations
    if ENV["ITERATIONS"]
      @iterations = 0..ENV["ITERATIONS"].to_i
    else
      @iterations = DEFAULT_ITERATIONS
    end
    @iterations
  end
end # def Flores::RSpec