Class: Luna::RSpec::Formatters::Documentation

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

Constant Summary

Constants included from Profile

Profile::EXAMPLES, Profile::EXAMPLES_HEADER, Profile::GROUPS, Profile::GROUPS_HEADER

Instance Method Summary collapse

Methods included from Profile

#dump_profile, #helpers

Instance Method Details

#example_failed(struct) ⇒ Object

– Failed. –



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

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

#example_passed(struct) ⇒ Object

– Passed. –



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

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

#example_pending(struct) ⇒ Object

– Pending. –



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

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

#get_example(struct) ⇒ Object

– Pull. –



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

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

– Description. –



91
92
93
94
95
# File 'lib/luna/rspec/formatters/fulldesc.rb', line 91

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

#start(_) ⇒ Object

– Start. –



39
40
41
# File 'lib/luna/rspec/formatters/fulldesc.rb', line 39

def start(_)
  output.puts
end

#start_dump(_) ⇒ Object

– End. –



46
47
48
# File 'lib/luna/rspec/formatters/fulldesc.rb', line 46

def start_dump(_)
  output.puts
end