Class: Luna::Formatters::Documentation

Inherits:
RSpec::Core::Formatters::BaseTextFormatter
  • Object
show all
Includes:
Profiling
Defined in:
lib/luna/rspec/formatters/docs.rb

Constant Summary

Constants included from Profiling

Profiling::EXP, Profiling::EXP_HEADER, Profiling::GROUPS, Profiling::GROUPS_HEADER

Instance Method Summary collapse

Methods included from Profiling

#dump_profile, #helpers

Instance Method Details

#example_failed(struct) ⇒ Object

– Failed. –



54
55
56
57
58
# File 'lib/luna/rspec/formatters/docs.rb', line 54

def example_failed(struct)
  output.print "\s"
  print_description(get_example(struct),
    :failure)
end

#example_passed(struct) ⇒ Object

– Passed. –



45
46
47
48
49
# File 'lib/luna/rspec/formatters/docs.rb', line 45

def example_passed(struct)
  output.print "\s"
  print_description(get_example(struct),
    :success)
end

#example_pending(struct) ⇒ Object

– Pending. –



63
64
65
66
67
# File 'lib/luna/rspec/formatters/docs.rb', line 63

def example_pending(struct)
  output.print "\s"
  print_description(get_example(struct),
    :pending)
end

#get_example(struct) ⇒ Object

– Pull. –



72
73
74
75
76
77
78
# File 'lib/luna/rspec/formatters/docs.rb', line 72

def get_example(struct)
  unless struct.respond_to?(:example)
    return struct
  end

  struct.example
end

– Description. –



83
84
85
86
# File 'lib/luna/rspec/formatters/docs.rb', line 83

def print_description(example, type)
  output.print send(:"#{type}_color", "  " +
    example.full_description + "\n")
end

#start(_) ⇒ Object

– Start. –



31
32
33
# File 'lib/luna/rspec/formatters/docs.rb', line 31

def start(_)
  output.puts
end

#start_dump(_) ⇒ Object

– End. –



38
39
40
# File 'lib/luna/rspec/formatters/docs.rb', line 38

def start_dump(_)
  output.puts
end