Skip to content

Commit

Permalink
Correct the arity on Reporter#initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
toothrot committed Dec 9, 2012
1 parent 230e45f commit 60434d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/riot/reporter.rb
Expand Up @@ -22,7 +22,8 @@ class Reporter
attr_accessor :current_context

# Creates a new Reporter instance and initializes counts to zero
def initialize
def initialize(*args)
@options = args.extract_options!
@passes = @failures = @errors = 0
@current_context = ""
end
Expand Down
4 changes: 2 additions & 2 deletions lib/riot/reporter/io.rb
Expand Up @@ -13,8 +13,8 @@ class IOReporter < Reporter
# @param [IO] writer the writer to use for results
# @param [Hash] options options for reporter
def initialize(*args)
super()
@options = (args.last.kind_of?(Hash) ? args.pop : {})
super
@options = args.extract_options!
@writer = (args.shift || STDOUT)
end

Expand Down
1 change: 1 addition & 0 deletions test/core/reports/basic_reporter_test.rb
Expand Up @@ -51,6 +51,7 @@ def results(time); end
context "instance" do
setup { Riot::Reporter.new }
should("return self invoking new") { topic.new }.equals { topic }
should("accept an options hash") { topic.new({}) }.equals { topic }
end

context "with no errors or failures" do
Expand Down

0 comments on commit 60434d3

Please sign in to comment.