module Fivemat

def self.new(*args)

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
    if ::Cucumber::VERSION >= '3'
      abort "Fivemat does not yet support Cucumber 3"
    end
    Cucumber
  else
    raise ArgumentError
  end.new(*args)
end

def initialize(runtime, path_or_io, options)

Cucumber 2 detects the formatter API based on initialize arity
def initialize(runtime, path_or_io, options)
end

def rspec3?

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