Permalink
Browse files

Don't extend RSpec BaseFormatter but instead delegate via method_missing

  • Loading branch information...
nicksieger committed Oct 9, 2012
1 parent 7d7346c commit 39692c47a8d79b5ec871a0f38a21254b3d4cb56c
Showing with 6 additions and 26 deletions.
  1. +6 −26 lib/ci/reporter/rspec.rb
View
@@ -86,20 +86,15 @@ def location
end
# Custom +RSpec+ formatter used to hook into the spec runs and capture results.
- class RSpec < RSpecFormatters::BaseFormatter
+ class RSpec
attr_accessor :report_manager
attr_accessor :formatter
def initialize(*args)
- super
@formatter ||= RSpecFormatters::ProgressFormatter.new(*args)
@report_manager = ReportManager.new("spec")
@suite = nil
end
- def start(spec_count)
- @formatter.start(spec_count)
- end
-
# rspec 0.9
def add_behaviour(name)
@formatter.add_behaviour(name)
@@ -117,10 +112,6 @@ def example_group_started(example_group)
@formatter.example_group_started(example_group)
new_suite(description_for(example_group))
end
-
- def example_group_finished(example_group)
- @formatter.example_group_finished(example_group)
- end
def example_started(name_or_example)
@formatter.example_started(name_or_example)
@@ -163,30 +154,19 @@ def example_pending(*args)
spec.skipped = true
end
- def start_dump
- @formatter.start_dump
- end
-
- def dump_failures(*args)
- @formatter.dump_failures(*args)
- end
-
- def dump_failure(*args)
- @formatter.dump_failure(*args)
- end
-
def dump_summary(*args)
@formatter.dump_summary(*args)
write_report
@formatter.dump_failures
end
- def dump_pending
- @formatter.dump_pending
+ def respond_to?(*args)
+ @formatter.respond_to?(*args)
end
- def close
- @formatter.close
+ # Pass through other methods to RSpec formatter for compatibility
+ def method_missing(meth,*args,&block)
+ @formatter.send(meth,*args,&block)
end
private

0 comments on commit 39692c4

Please sign in to comment.