rails_plugins/rspec/lib/spec/runner/options.rb in picolena-0.1.5 vs rails_plugins/rspec/lib/spec/runner/options.rb in picolena-0.1.6

- old
+ new

@@ -98,11 +98,11 @@ @examples_run end def examples_should_not_be_run @examples_should_be_run = false - end + end def colour=(colour) @colour = colour if @colour && RUBY_PLATFORM =~ /win32/ ;\ begin ;\ @@ -145,21 +145,21 @@ @out_used = true end @format_options ||= [] @format_options << [format, where] end - + def formatters @format_options ||= [['progress', @output_stream]] @formatters ||= load_formatters(@format_options, EXAMPLE_FORMATTERS) end def story_formatters @format_options ||= [['plain', @output_stream]] @formatters ||= load_formatters(@format_options, STORY_FORMATTERS) end - + def load_formatters(format_options, formatters) format_options.map do |format, where| formatter_type = if formatters[format] require formatters[format][0] eval(formatters[format][1], binding, __FILE__, __LINE__) @@ -195,17 +195,17 @@ raise "File or directory not found: #{file}" end end result end - + protected def examples_should_be_run? return @examples_should_be_run unless @examples_should_be_run.nil? @examples_should_be_run = true end - + def differ_class=(klass) return unless klass @differ_class = klass Spec::Expectations.differ = self.differ_class.new(self) end @@ -225,27 +225,27 @@ @error_stream.puts "Couldn't find #{kind} class #{name}" @error_stream.puts "Make sure the --require option is specified *before* #{option}" if $_spec_spec ; raise e ; else exit(1) ; end end end - + def custom_runner return nil unless custom_runner? klass_name, arg = ClassAndArgumentsParser.parse(user_input_for_runner) runner_type = load_class(klass_name, 'behaviour runner', '--runner') return runner_type.new(self, arg) end def custom_runner? return user_input_for_runner ? true : false end - + def heckle returns = self.heckle_runner.heckle_with self.heckle_runner = nil returns end - + def sorted_files return sorter ? files.sort(&sorter) : files end def sorter