module AvocadoFormatter

Public Class Methods

cucumber2?() click to toggle source
# File lib/avocado_formatter.rb, line 8
def cucumber2?
  defined?(::Cucumber) && ::Cucumber::VERSION >= '2.0.0'
end
new(runtime, path_or_io, options) click to toggle source

Cucumber 2 detects the formatter API based on initialize arity

# File lib/avocado_formatter.rb, line 15
def initialize(runtime, path_or_io, options)
end
new(*args) click to toggle source
# File lib/avocado_formatter.rb, line 38
def self.new(*args)
  case args.size
  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?() click to toggle source
# File lib/avocado_formatter.rb, line 19
def rspec3?
  defined?(::RSpec::Core) && ::RSpec::Core::Version::STRING >= '3.0.0'
end

Private Instance Methods

cucumber2?() click to toggle source
# File lib/avocado_formatter.rb, line 8
def cucumber2?
  defined?(::Cucumber) && ::Cucumber::VERSION >= '2.0.0'
end
rspec3?() click to toggle source
# File lib/avocado_formatter.rb, line 19
def rspec3?
  defined?(::RSpec::Core) && ::RSpec::Core::Version::STRING >= '3.0.0'
end