Sha256: 99662f5ac9feb4394547664680fa540bef07ed878af5387ce88c1ca26e1f7690

Contents?: true

Size: 992 Bytes

Versions: 17

Compression:

Stored size: 992 Bytes

Contents

require 'fivemat/elapsed_time'

module Fivemat
  autoload :Cucumber, 'fivemat/cucumber'
  autoload :MiniTest, 'fivemat/minitest/unit'
  autoload :RSpec, 'fivemat/rspec'
  autoload :RSpec3, 'fivemat/rspec3'
  autoload :Spec, 'fivemat/spec'

  def rspec3?
    defined?(::RSpec::Core) && ::RSpec::Core::Version::STRING >= '3.0.0'
  end
  module_function :rspec3?

  if rspec3?
    # This needs to be run before `.new` is called, so putting it inside the
    # autoloaded rspec3 file will not work.
    ::RSpec::Core::Formatters.register self,
      :example_passed,
      :example_pending,
      :example_failed,
      :example_group_started,
      :example_group_finished,
      :dump_summary,
      :seed,
      :message
  end

  def self.new(*args)
    case args.size
    when 0 then MiniTest::Unit
    when 1 then
      if rspec3?
        RSpec3
      else
        RSpec
      end
    when 2 then Spec
    when 3 then Cucumber
    else
      raise ArgumentError
    end.new(*args)
  end
end

Version data entries

17 entries across 17 versions & 7 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/fivemat-1.3.2/lib/fivemat.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/fivemat-1.3.2/lib/fivemat.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/fivemat-1.3.2/lib/fivemat.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/fivemat-1.3.2/lib/fivemat.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/fivemat-1.3.2/lib/fivemat.rb
fivemat-1.3.2 lib/fivemat.rb