[rspec-users] changes in rspec 2.4 break ci_reporter
David Chelimsky
dchelimsky at gmail.com
Thu Jan 27 05:05:29 EST 2011
On Jan 26, 2011, at 8:43 AM, vishnu wrote:
> Hi
> I use the ci_reporter gem for builds on my CI machine (hudson).
> Prior to rspec 2.4, environment options would override commandline
> options. So the gem used this to change the formatter and require its
> files.
>
> In 2.4, that order has been reversed.
This has since been restored to its previous behavior, to be released in 2.5. See https://github.com/rspec/rspec-core/issues/276.
> the thing is 2.4 supports multiple formatters, so there is another suggestion.
>
> RSpec::Core::ConfigurationOptions
> def parse_options
> @options = begin
> options_to_merge = []
> if custom_options_file
> options_to_merge << custom_options
> else
> options_to_merge << global_options
> options_to_merge << local_options
> end
> options_to_merge << env_options
> options_to_merge << command_line_options
>
> options_to_merge.inject do |merged, options|
> merged.merge(options)
> end
> end
> end
>
> the last section, instead of merging hashes, could combine the values
> of all hashes with the keys "--require" or "--format". So you get the
> default formatter and the extra formatter that ci_reporter introduces.
I think I'd want a separate API for this - something like:
# ~/.rspec
--format-that-is-not-overridden html
--out-that-is-not-overridden ~/rspec/this-project/report.html
But maybe a bit less verbose :) Either that or maybe a marker option like this:
# ~/.rspec
--color
--backtrace
--no-override
--require ~/path/to/file/to/always/require
--format html
--out ~/rspec/this-project/report.html
Then require, format, and out options following the --no-override option would be additive.
WDYT? Other ideas?
More information about the rspec-users
mailing list