Class: RSpec::Formatter::GitAutoCommitRSpec2
- Inherits:
-
Core::Formatters::BaseTextFormatter
- Object
- Core::Formatters::BaseTextFormatter
- RSpec::Formatter::GitAutoCommitRSpec2
- Defined in:
- lib/rspec/formatter/git_auto_commit_rspec2.rb
Constant Summary collapse
- GIT_PROG =
ENV["GIT_BIN"] || "git"
Instance Method Summary collapse
- #dump_failures ⇒ Object
- #dump_pending ⇒ Object
- #dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
- #message(message) ⇒ Object
- #seed(number) ⇒ Object
Instance Method Details
#dump_failures ⇒ Object
11 12 |
# File 'lib/rspec/formatter/git_auto_commit_rspec2.rb', line 11 def dump_failures end |
#dump_pending ⇒ Object
14 15 |
# File 'lib/rspec/formatter/git_auto_commit_rspec2.rb', line 14 def dump_pending end |
#dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rspec/formatter/git_auto_commit_rspec2.rb', line 20 def dump_summary(duration, example_count, failure_count, pending_count) state = failure_count == 0 ? "[green]" : "[red]" summary = summary_line(example_count, failure_count, pending_count) duration = "in #{format_duration(duration)}" = [state, summary, duration].join(" ") unless failed_examples.empty? << "\n\nFailed Examples:\n\n" failed_examples.each_with_index do |example, index| << "#{short_padding}#{index.next}) #{example.full_description}\n\n" end end system("#{GIT_PROG} add -u") << "\n\n" << `#{GIT_PROG} diff --cached` << "\n\n" << "File Status:\n" << `#{GIT_PROG} status -s` File.popen("#{GIT_PROG} commit -F -", "r+") do |fd| fd.write fd.close end log = `#{GIT_PROG} log --oneline -n 1` output.puts "\nAuto committed.\n" output.puts colorise_summary(log) end |
#message(message) ⇒ Object
8 9 |
# File 'lib/rspec/formatter/git_auto_commit_rspec2.rb', line 8 def () end |
#seed(number) ⇒ Object
17 18 |
# File 'lib/rspec/formatter/git_auto_commit_rspec2.rb', line 17 def seed(number) end |