Module: Fivemat

Defined in:
lib/fivemat.rb,
lib/fivemat/spec.rb,
lib/fivemat/rspec.rb,
lib/fivemat/rspec3.rb,
lib/fivemat/cucumber.rb,
lib/fivemat/minitest/unit.rb

Defined Under Namespace

Modules: MiniTest Classes: Cucumber, RSpec, RSpec3, Spec

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.cucumber2?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/fivemat.rb', line 10

def cucumber2?
  defined?(::Cucumber) && ::Cucumber::VERSION >= '2.0.0'
end

.new(*args) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fivemat.rb', line 40

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

.rspec3?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/fivemat.rb', line 21

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

Instance Method Details

#initialize(runtime, path_or_io, options) ⇒ Object

Cucumber 2 detects the formatter API based on initialize arity



17
18
# File 'lib/fivemat.rb', line 17

def initialize(runtime, path_or_io, options)
end