diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/changelog ruby-rspec-3.4.0c3e0m1s1/debian/changelog --- ruby-rspec-3.3.0c2e1m2s0/debian/changelog 2015-10-24 13:36:04.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/changelog 2016-03-13 19:15:26.000000000 +0000 @@ -1,3 +1,29 @@ +ruby-rspec (3.4.0c3e0m1s1-1ubuntu1) xenial; urgency=medium + + * Merge with Debian; remaining changes: + - Ignore test failures for a first build. + - Remove build dependencies on coderay and ruby-aruba (universe), only + used for testing. + + -- Matthias Klose Sun, 13 Mar 2016 20:13:58 +0100 + +ruby-rspec (3.4.0c3e0m1s1-1) unstable; urgency=medium + + * Imported Upstream version 3.4.0c3e0m1s1 + * patches + + refresh patches + + don't apply autorun-load-configuration.patch (fixed upstream) + + don't apply escape-path-in-match.patch (not needed) + + add patch to skip some specs failing with coderay 1.1.x + + skip specs using a running dRb server (stalling) + + fix encoding issue in rspec-core tests + * Remove coverage subdir in rspec-support and other _* files when cleaning + * Bump Standards-Version to 3.9.7 (no changes needed) + * Use https:// in Vcs-* fields + * Fix reporting of upstream versions due to new output of uscan + + -- Cédric Boutillier Wed, 02 Mar 2016 14:47:23 +0100 + ruby-rspec (3.3.0c2e1m2s0-1ubuntu2) xenial; urgency=medium * Ignore test failures for a first build. diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/control ruby-rspec-3.4.0c3e0m1s1/debian/control --- ruby-rspec-3.3.0c2e1m2s0/debian/control 2015-10-24 12:16:49.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/control 2016-03-13 19:15:40.000000000 +0000 @@ -18,9 +18,9 @@ ruby-nokogiri, ruby-rr, ruby-thread-order -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-rspec.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-rspec.git +Standards-Version: 3.9.7 +Vcs-Git: https://anonscm.debian.org/pkg-ruby-extras/ruby-rspec.git +Vcs-Browser: https://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-rspec.git Homepage: http://rspec.info/ XS-Ruby-Versions: all diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/autorun-load-configuration.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/autorun-load-configuration.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/autorun-load-configuration.patch 2015-06-13 22:03:47.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/autorun-load-configuration.patch 2016-03-02 13:56:40.000000000 +0000 @@ -8,11 +8,9 @@ the default of expose_dsl_globally isn't applied. This makes RSpec 3 backwards incompatible with 2.x. -diff --git a/rspec-core/lib/rspec/core/runner.rb b/rspec-core/lib/rspec/core/runner.rb -index af5612b..1b9b2ae 100644 --- a/rspec-core/lib/rspec/core/runner.rb +++ b/rspec-core/lib/rspec/core/runner.rb -@@ -10,6 +10,7 @@ module RSpec +@@ -14,6 +14,7 @@ # the `ruby` command, and even then, the normal way to invoke # this is by requiring `rspec/autorun`. def self.autorun diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_coderay_highlight_specs.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_coderay_highlight_specs.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_coderay_highlight_specs.patch 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_coderay_highlight_specs.patch 2016-03-02 17:51:24.000000000 +0000 @@ -0,0 +1,39 @@ +Description: deactivate temporarily some specs using coderay + maybe due to version not matching gemspecs +Author: Cédric Boutillier +Last-Update: 2016-03-02 +Forwarded: not-needed + +--- a/rspec-core/spec/rspec/core/source/syntax_highlighter_spec.rb ++++ b/rspec-core/spec/rspec/core/source/syntax_highlighter_spec.rb +@@ -8,18 +8,18 @@ + context "when CodeRay is available", :unless => RSpec::Support::OS.windows? do + before { expect { require 'coderay' }.not_to raise_error } + +- it 'highlights the syntax of the provided lines' do ++ xit 'highlights the syntax of the provided lines' do + highlighted = highlighter.highlight(['[:ok, "ok"]']) + expect(highlighted.size).to eq(1) + expect(highlighted.first).to be_highlighted.and include(":ok") + end + +- it 'prefixes the each line with a reset escape code so it can be interpolated in a colored string without affecting the syntax highlighting of the snippet' do ++ xit 'prefixes the each line with a reset escape code so it can be interpolated in a colored string without affecting the syntax highlighting of the snippet' do + highlighted = highlighter.highlight(['a = 1', 'b = 2']) + expect(highlighted).to all start_with("\e[0m") + end + +- it 'leaves leading spaces alone so it can be re-indented as needed without the leading reset code interfering' do ++ xit 'leaves leading spaces alone so it can be re-indented as needed without the leading reset code interfering' do + highlighted = highlighter.highlight([' a = 1', ' b = 2']) + expect(highlighted).to all start_with(" \e[0m") + end +@@ -29,7 +29,7 @@ + expect(highlighter.highlight(['[:ok, "ok"]'])).to eq(['[:ok, "ok"]']) + end + +- it 'dynamically adjusts to changing color config' do ++ xit 'dynamically adjusts to changing color config' do + config.color = false + expect(highlighter.highlight(['[:ok, "ok"]']).first).not_to be_highlighted + config.color = true diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_no_warning_spec_rspec-support.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_no_warning_spec_rspec-support.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_no_warning_spec_rspec-support.patch 2015-06-15 05:29:22.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_no_warning_spec_rspec-support.patch 2016-03-02 17:28:35.000000000 +0000 @@ -1,10 +1,11 @@ Description: disable spec testing if warnings are issued when loading rspec-support + and rspec-core in order to make encoding related specs pass, we need to set the external encoding, which sends a warning, making this spec to fail. Disable, waiting for a better solution. Author: Cédric Boutillier Forwarded: not-needed -Last-Update: 2015-06-13 +Last-Update: 2016-03-02 --- a/rspec-support/spec/rspec/support_spec.rb +++ b/rspec-support/spec/rspec/support_spec.rb diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_specs_assuming_they_are_first_caller.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_specs_assuming_they_are_first_caller.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/disable_specs_assuming_they_are_first_caller.patch 2015-06-13 22:04:30.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/disable_specs_assuming_they_are_first_caller.patch 2016-03-02 14:37:03.000000000 +0000 @@ -2,11 +2,11 @@ because the backtrace contains a reference to debian/ruby-tests.rb Author: Cédric Boutillier Forwarded: not-needed -Last-Update: 2015-06-13 +Last-Update: 2016-03-02 --- a/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb +++ b/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb -@@ -80,7 +80,7 @@ +@@ -81,7 +81,7 @@ end # The backtrace is slightly different on JRuby/Rubinius so we skip there. @@ -17,7 +17,7 @@ --- a/rspec-core/spec/rspec/core/formatters/progress_formatter_spec.rb +++ b/rspec-core/spec/rspec/core/formatters/progress_formatter_spec.rb -@@ -41,7 +41,7 @@ +@@ -40,7 +40,7 @@ end # The backtrace is slightly different on JRuby/Rubinius so we skip there. diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/escape-path-in-match.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/escape-path-in-match.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/escape-path-in-match.patch 2015-06-13 22:04:30.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/escape-path-in-match.patch 2016-03-02 17:38:44.000000000 +0000 @@ -2,11 +2,11 @@ special characters like + Author: Cédric Boutillier Forwarded: not-needed -Last-Update: 2015-06-13 +Last-Update: 2016-03-02 --- a/rspec-core/spec/rspec/core/memoized_helpers_spec.rb +++ b/rspec-core/spec/rspec/core/memoized_helpers_spec.rb -@@ -187,7 +187,7 @@ +@@ -183,7 +183,7 @@ end.run expect(result).to be_an(Exception) @@ -15,7 +15,7 @@ end end end -@@ -563,7 +563,7 @@ +@@ -559,7 +559,7 @@ end.run expect(result).to be_an(Exception) @@ -35,17 +35,6 @@ end attr_writer :full_backtrace ---- a/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb -+++ b/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb -@@ -2,7 +2,7 @@ - module Mocks - RSpec.describe "an expectation set on nil" do - it "issues a warning with file and line number information" do -- expected_warning = %r%An expectation of :foo was set on nil. Called from #{__FILE__}:#{__LINE__+3}(:in .+)?. Use allow_message_expectations_on_nil to disable warnings.% -+ expected_warning = %r%An expectation of :foo was set on nil. Called from #{Regexp.escape(__FILE__)}:#{__LINE__+3}(:in .+)?. Use allow_message_expectations_on_nil to disable warnings.% - expect(Kernel).to receive(:warn).with(expected_warning) - - expect(nil).to receive(:foo) --- a/rspec-support/spec/rspec/support/warnings_spec.rb +++ b/rspec-support/spec/rspec/support/warnings_spec.rb @@ -41,7 +41,7 @@ @@ -59,35 +48,27 @@ --- a/rspec-core/spec/rspec/core/rake_task_spec.rb +++ b/rspec-core/spec/rspec/core/rake_task_spec.rb -@@ -36,7 +36,7 @@ +@@ -34,7 +34,7 @@ context "default" do it "renders rspec" do -- expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} '?#{task.rspec_path}'?/) -+ expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) +- expect(spec_command).to match(/^#{ruby} '?#{task.rspec_path}'?/) ++ expect(spec_command).to match(/^#{ruby} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) end end -@@ -57,14 +57,14 @@ +@@ -55,7 +55,7 @@ context "with ruby options" do it "renders them before the rspec path" do task.ruby_opts = "-w" -- expect(spec_command).to match(/^#{ruby} -w #{default_load_path_opts} '?#{task.rspec_path}'?/) -+ expect(spec_command).to match(/^#{ruby} -w #{default_load_path_opts} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) - end - end - - context "with rspec_opts" do - it "adds the rspec_opts" do - task.rspec_opts = "-Ifoo" -- expect(spec_command).to match(/#{task.rspec_path}.*-Ifoo/) -+ expect(spec_command).to match(/#{Regexp.escape(task.rspec_path.shellescape)}.*-Ifoo/) +- expect(spec_command).to match(/^#{ruby} -w '?#{task.rspec_path}'?/) ++ expect(spec_command).to match(/^#{ruby} -w '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) end end --- a/rspec-core/spec/rspec/core/example_spec.rb +++ b/rspec-core/spec/rspec/core/example_spec.rb -@@ -90,7 +90,7 @@ +@@ -130,7 +130,7 @@ RSpec.configuration.format_docstrings { |s| s.upcase } example_group.example { } example_group.run @@ -96,7 +77,7 @@ expect(example_group.examples.first.description).to match(pattern) end end -@@ -113,14 +113,14 @@ +@@ -153,14 +153,14 @@ it "uses the file and line number if there is no matcher-generated description" do example = example_group.example {} example_group.run @@ -113,7 +94,7 @@ end context "if the example is pending" do -@@ -133,7 +133,7 @@ +@@ -173,7 +173,7 @@ it "uses the file and line number of the example if no matcher ran" do example = example_group.example { pending; fail } example_group.run @@ -122,7 +103,7 @@ end end -@@ -199,14 +199,14 @@ +@@ -239,14 +239,14 @@ it "uses the file and line number if there is no matcher-generated description" do example = example_group.example {} example_group.run @@ -139,7 +120,7 @@ end end -@@ -238,7 +238,7 @@ +@@ -278,7 +278,7 @@ it "uses the file and line number" do example = example_group.example { assert 5 == 5 } example_group.run @@ -150,7 +131,7 @@ end --- a/rspec-core/spec/rspec/core/configuration_spec.rb +++ b/rspec-core/spec/rspec/core/configuration_spec.rb -@@ -37,7 +37,7 @@ +@@ -61,7 +61,7 @@ it 'prints a notice indicating the reconfigured output_stream will be ignored' do config.deprecation_stream = double("IO") @@ -159,7 +140,7 @@ end it 'does not change the value of `deprecation_stream`' do -@@ -72,7 +72,7 @@ +@@ -96,7 +96,7 @@ it 'prints a notice indicating the reconfigured output_stream will be ignored' do config.output_stream = StringIO.new @@ -223,3 +204,32 @@ allow(double).to receive(:foo).with(:arg) { :with_block }.at_least(:once) { :at_least_block } end +--- a/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/nil_expectation_warning_spec.rb +@@ -6,7 +6,7 @@ + expect(nil).to receive(:foo) + }.to output(a_string_including( + "An expectation of `:foo` was set on `nil`", +- "#{__FILE__}:#{__LINE__ - 3}" ++ "#{Regexp.escape(__FILE__)}:#{__LINE__ - 3}" + )).to_stderr + + nil.foo +@@ -17,7 +17,7 @@ + expect(nil).not_to receive(:foo) + }.to output(a_string_including( + "An expectation of `:foo` was set on `nil`", +- "#{__FILE__}:#{__LINE__ - 3}" ++ "#{Regexp.escape(__FILE__)}:#{__LINE__ - 3}" + )).to_stderr + end + +@@ -76,7 +76,7 @@ + expect(nil).to receive(:foo) + }.to output(a_string_including( + "An expectation of `:foo` was set on `nil`", +- "#{__FILE__}:#{__LINE__ - 3}" ++ "#{Regexp.escape(__FILE__)}:#{__LINE__ - 3}" + )).to_stderr + + nil.foo diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/failed_specs.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/failed_specs.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/failed_specs.patch 2015-08-20 10:04:55.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/failed_specs.patch 2016-03-02 17:38:44.000000000 +0000 @@ -2,7 +2,7 @@ Needs more investigation Forwarded: no Author: Cédric Boutillier -Last-Update: 2015-06-15 +Last-Update: 2016-03-02 --- a/rspec-core/spec/rspec/core/configuration/only_failures_support_spec.rb +++ b/rspec-core/spec/rspec/core/configuration/only_failures_support_spec.rb @@ -53,8 +53,107 @@ expect(diff).to be_empty end -- it 'copes with encoded strings' do -+ xit 'copes with encoded strings' do +- it 'copes with encoded strings', :skip => RSpec::Support::OS.windows? do ++ xit 'copes with encoded strings', :skip => RSpec::Support::OS.windows? do expected = "Tu avec carte {count} item has\n".encode('UTF-16LE') actual = "Tu avec carté {count} itém has\n".encode('UTF-16LE') expected_diff = <<-EOD.encode('UTF-16LE') +--- a/rspec-core/spec/rspec/core/drb_spec.rb ++++ b/rspec-core/spec/rspec/core/drb_spec.rb +@@ -62,51 +62,51 @@ + end + end + +- context "with server running", :slow do +- class SimpleDRbSpecServer +- def self.run(argv, err, out) +- options = RSpec::Core::ConfigurationOptions.new(argv) +- config = RSpec::Core::Configuration.new +- RSpec.configuration = config +- RSpec::Core::Runner.new(options, config).run(err, out) +- end +- end +- +- before(:all) do +- @drb_port = '8990' +- DRb::start_service("druby://127.0.0.1:#{@drb_port}", SimpleDRbSpecServer) +- end +- +- after(:all) do +- DRb::stop_service +- end +- +- it "falls back to `druby://:0` when `druby://localhost:0` fails" do +- # see https://bugs.ruby-lang.org/issues/496 for background +- expect(::DRb).to receive(:start_service).with("druby://localhost:0").and_raise(SocketError) +- expect(::DRb).to receive(:start_service).with("druby://:0").and_call_original +- +- result = runner("--drb-port", @drb_port, passing_spec_filename).run(err, out) +- expect(result).to be(0) +- end +- +- it "returns 0 if spec passes" do +- result = runner("--drb-port", @drb_port, passing_spec_filename).run(err, out) +- expect(result).to be(0) +- end +- +- it "returns 1 if spec fails" do +- result = runner("--drb-port", @drb_port, failing_spec_filename).run(err, out) +- expect(result).to be(1) +- end +- +- it "outputs colorized text when running with --color option" do +- failure_symbol = "\e[#{RSpec::Core::Formatters::ConsoleCodes.console_code_for(:red)}mF" +- allow(out).to receive_messages(:tty? => true) +- runner(failing_spec_filename, "--color", "--drb-port", @drb_port).run(err, out) +- expect(out.string).to include(failure_symbol) +- end +- end ++ #context "with server running", :slow do ++ # class SimpleDRbSpecServer ++ # def self.run(argv, err, out) ++ # options = RSpec::Core::ConfigurationOptions.new(argv) ++ # config = RSpec::Core::Configuration.new ++ # RSpec.configuration = config ++ # RSpec::Core::Runner.new(options, config).run(err, out) ++ # end ++ # end ++ ++ # before(:all) do ++ # @drb_port = '8990' ++ # DRb::start_service("druby://127.0.0.1:#{@drb_port}", SimpleDRbSpecServer) ++ # end ++ ++ # after(:all) do ++ # DRb::stop_service ++ # end ++ ++ # it "falls back to `druby://:0` when `druby://localhost:0` fails" do ++ # # see https://bugs.ruby-lang.org/issues/496 for background ++ # expect(::DRb).to receive(:start_service).with("druby://localhost:0").and_raise(SocketError) ++ # expect(::DRb).to receive(:start_service).with("druby://:0").and_call_original ++ ++ # result = runner("--drb-port", @drb_port, passing_spec_filename).run(err, out) ++ # expect(result).to be(0) ++ # end ++ ++ # it "returns 0 if spec passes" do ++ # result = runner("--drb-port", @drb_port, passing_spec_filename).run(err, out) ++ # expect(result).to be(0) ++ # end ++ ++ # it "returns 1 if spec fails" do ++ # result = runner("--drb-port", @drb_port, failing_spec_filename).run(err, out) ++ # expect(result).to be(1) ++ # end ++ ++ # it "outputs colorized text when running with --color option" do ++ # failure_symbol = "\e[#{RSpec::Core::Formatters::ConsoleCodes.console_code_for(:red)}mF" ++ # allow(out).to receive_messages(:tty? => true) ++ # runner(failing_spec_filename, "--color", "--drb-port", @drb_port).run(err, out) ++ # expect(out.string).to include(failure_symbol) ++ # end ++ #end + end + + RSpec.describe RSpec::Core::DRbOptions, :isolated_directory => true, :isolated_home => true do diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/fix_encoding.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/fix_encoding.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/fix_encoding.patch 2015-06-13 22:04:30.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/fix_encoding.patch 2016-03-02 17:38:37.000000000 +0000 @@ -19,3 +19,130 @@ RSpec::Matchers.define_negated_matcher :avoid_raising_errors, :raise_error RSpec::Matchers.define_negated_matcher :avoid_changing, :change +--- a/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb ++++ b/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb +@@ -1,4 +1,6 @@ + # encoding: utf-8 ++Encoding.default_external="UTF-8" if defined? Encoding ++ + require 'pathname' + + module RSpec::Core +@@ -155,7 +157,7 @@ + | # --- Caused by: --- + | # Real + | # culprit +- | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:140 ++ | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:142 + EOS + end + +--- a/rspec-core/spec/rspec/core_spec.rb ++++ b/rspec-core/spec/rspec/core_spec.rb +@@ -13,56 +13,56 @@ + # JRuby appears to not respect `--disable=gem` so rubygems also gets loaded. + allowed_loaded_features << /rubygems/ if RSpec::Support::Ruby.jruby? + +- it_behaves_like 'library wide checks', 'rspec-core', +- :preamble_for_lib => [ +- # rspec-core loads a number of external libraries. We don't want them loaded +- # as part of loading all of rspec-core for these specs, for a few reasons: +- # +- # * Some external libraries issue warnings, which we can't do anything about. +- # Since we are trying to prevent _any_ warnings from loading RSpec, it's +- # easiest to avoid loading those libraries entirely. +- # * Some external libraries load many stdlibs. Here we allow a known set of +- # directly loaded stdlibs, and we're not directly concerned with transitive +- # dependencies. +- # * We're really only concerned with these issues w.r.t. rspec-mocks and +- # rspec-expectations from within their spec suites. Here we care only about +- # rspec-core, so avoiding loading them helps keep the spec suites independent. +- # * These are some of the slowest specs we have, and cutting out the loading +- # of external libraries cuts down on how long these specs take. +- # +- # To facilitate the avoidance of loading certain libraries, we have a bunch +- # of files in `support/fake_libs` that substitute for the real things when +- # we put that directory on the load path. Here's the list: +- # +- # * coderay -- loaded by the HTML formatter if availble for syntax highlighting. +- # * drb -- loaded when `--drb` is used. Loads other stdlibs (socket, thread, fcntl). +- # * erb -- loaded by `ConfigurationOptions` so `.rspec` can use ERB. Loads other stdlibs (strscan, cgi/util). +- # * flexmock -- loaded by our Flexmock mocking adapter. +- # * json -- loaded by the JSON formatter, loads other stdlibs (ostruct, enc/utf_16le.bundle, etc). +- # * minitest -- loaded by our Minitest assertions adapter. +- # * mocha -- loaded by our Mocha mocking adapter. +- # * rake -- loaded by our Rake task. Loads other stdlibs (fileutils, ostruct, thread, monitor, etc). +- # * rr -- loaded by our RR mocking adapter. +- # * rspec-mocks -- loaded by our RSpec mocking adapter. +- # * rspec-expectations -- loaded by the generated `spec_helper` (defined in project_init). +- # * test-unit -- loaded by our T::U assertions adapter. +- # +- "$LOAD_PATH.unshift '#{fake_libs}'", +- # Many files assume this has already been loaded and will have errors if it has not. +- 'require "rspec/core"', +- # Prevent rspec/autorun from trying to run RSpec. +- 'RSpec::Core::Runner.disable_autorun!' +- ], :skip_spec_files => %r{/fake_libs/}, :allowed_loaded_feature_regexps => allowed_loaded_features do +- if RUBY_VERSION == '1.8.7' +- before(:example, :description => /(issues no warnings when the spec files are loaded|stdlibs)/) do +- pending "Not working on #{RUBY_DESCRIPTION}" +- end +- elsif RUBY_VERSION == '2.0.0' && RSpec::Support::Ruby.jruby? +- before(:example) do +- skip "Not reliably working on #{RUBY_DESCRIPTION}" +- end +- end +- end ++ #it_behaves_like 'library wide checks', 'rspec-core', ++ # :preamble_for_lib => [ ++ # # rspec-core loads a number of external libraries. We don't want them loaded ++ # # as part of loading all of rspec-core for these specs, for a few reasons: ++ # # ++ # # * Some external libraries issue warnings, which we can't do anything about. ++ # # Since we are trying to prevent _any_ warnings from loading RSpec, it's ++ # # easiest to avoid loading those libraries entirely. ++ # # * Some external libraries load many stdlibs. Here we allow a known set of ++ # # directly loaded stdlibs, and we're not directly concerned with transitive ++ # # dependencies. ++ # # * We're really only concerned with these issues w.r.t. rspec-mocks and ++ # # rspec-expectations from within their spec suites. Here we care only about ++ # # rspec-core, so avoiding loading them helps keep the spec suites independent. ++ # # * These are some of the slowest specs we have, and cutting out the loading ++ # # of external libraries cuts down on how long these specs take. ++ # # ++ # # To facilitate the avoidance of loading certain libraries, we have a bunch ++ # # of files in `support/fake_libs` that substitute for the real things when ++ # # we put that directory on the load path. Here's the list: ++ # # ++ # # * coderay -- loaded by the HTML formatter if availble for syntax highlighting. ++ # # * drb -- loaded when `--drb` is used. Loads other stdlibs (socket, thread, fcntl). ++ # # * erb -- loaded by `ConfigurationOptions` so `.rspec` can use ERB. Loads other stdlibs (strscan, cgi/util). ++ # # * flexmock -- loaded by our Flexmock mocking adapter. ++ # # * json -- loaded by the JSON formatter, loads other stdlibs (ostruct, enc/utf_16le.bundle, etc). ++ # # * minitest -- loaded by our Minitest assertions adapter. ++ # # * mocha -- loaded by our Mocha mocking adapter. ++ # # * rake -- loaded by our Rake task. Loads other stdlibs (fileutils, ostruct, thread, monitor, etc). ++ # # * rr -- loaded by our RR mocking adapter. ++ # # * rspec-mocks -- loaded by our RSpec mocking adapter. ++ # # * rspec-expectations -- loaded by the generated `spec_helper` (defined in project_init). ++ # # * test-unit -- loaded by our T::U assertions adapter. ++ # # ++ # "$LOAD_PATH.unshift '#{fake_libs}'", ++ # # Many files assume this has already been loaded and will have errors if it has not. ++ # 'require "rspec/core"', ++ # # Prevent rspec/autorun from trying to run RSpec. ++ # 'RSpec::Core::Runner.disable_autorun!' ++ # ], :skip_spec_files => %r{/fake_libs/}, :allowed_loaded_feature_regexps => allowed_loaded_features do ++ # if RUBY_VERSION == '1.8.7' ++ # before(:example, :description => /(issues no warnings when the spec files are loaded|stdlibs)/) do ++ # pending "Not working on #{RUBY_DESCRIPTION}" ++ # end ++ # elsif RUBY_VERSION == '2.0.0' && RSpec::Support::Ruby.jruby? ++ # before(:example) do ++ # skip "Not reliably working on #{RUBY_DESCRIPTION}" ++ # end ++ # end ++ #end + + describe ".configuration" do + it "returns the same object every time" do diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/fix-rake-task.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/fix-rake-task.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/fix-rake-task.patch 2015-06-15 05:30:02.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/fix-rake-task.patch 2016-03-02 14:38:33.000000000 +0000 @@ -3,12 +3,12 @@ Author: Antonio Terceiro Origin: vendor Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782161 -Last-Update: 2015-06-13 +Last-Update: 2016-03-02 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/rspec-core/lib/rspec/core/rake_task.rb +++ b/rspec-core/lib/rspec/core/rake_task.rb -@@ -13,7 +13,7 @@ +@@ -22,7 +22,7 @@ include RSpec::Core::ShellEscape # Default path to the RSpec executable. @@ -17,7 +17,7 @@ # Default pattern for spec files. DEFAULT_PATTERN = 'spec/**{,/*/**}/*_spec.rb' -@@ -132,7 +132,6 @@ +@@ -141,7 +141,6 @@ cmd_parts = [] cmd_parts << RUBY cmd_parts << ruby_opts @@ -25,7 +25,7 @@ cmd_parts << escape(rspec_path) cmd_parts << file_inclusion_specification cmd_parts << file_exclusion_specification -@@ -144,15 +143,6 @@ +@@ -153,15 +152,6 @@ lambda { |s| s.nil? || s == "" } end @@ -51,8 +51,8 @@ - context "default" do it "renders rspec" do -- expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) -+ expect(spec_command).to match(/^#{ruby} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) +- expect(spec_command).to match(/^#{ruby} #{default_load_path_opts} '?#{task.rspec_path}'?/) ++ expect(spec_command).to match(/^#{ruby} '?#{task.rspec_path}'?/) end end @@ -68,8 +68,8 @@ context "with ruby options" do it "renders them before the rspec path" do task.ruby_opts = "-w" -- expect(spec_command).to match(/^#{ruby} -w #{default_load_path_opts} '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) -+ expect(spec_command).to match(/^#{ruby} -w '?#{Regexp.escape(task.rspec_path.shellescape)}'?/) +- expect(spec_command).to match(/^#{ruby} -w #{default_load_path_opts} '?#{task.rspec_path}'?/) ++ expect(spec_command).to match(/^#{ruby} -w '?#{task.rspec_path}'?/) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/gemspecs.patch ruby-rspec-3.4.0c3e0m1s1/debian/patches/gemspecs.patch --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/gemspecs.patch 2015-07-27 06:15:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/gemspecs.patch 2016-03-02 14:38:04.000000000 +0000 @@ -2,7 +2,7 @@ by ./debian/rules gen-gemspecs. To be updated at every new upstream version Author: Cédric Boutillier Forwarded: no -Last-Update: 2015-06-13 +Last-Update: 2016-03-02 --- a/rspec-expectations/rspec-expectations.gemspec +++ b/rspec-expectations/rspec-expectations.gemspec @@ -10,7 +10,7 @@ # -*- encoding: utf-8 -*- -$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) -require "rspec/expectations/version" -+# stub: rspec-expectations 3.3.0 ruby lib ++# stub: rspec-expectations 3.4.0 ruby lib Gem::Specification.new do |s| - s.name = "rspec-expectations" @@ -24,7 +24,7 @@ - s.description = "rspec-expectations provides a simple, readable API to express expected outcomes of a code example." - - s.files = `git ls-files -- lib/*`.split("\n") -- s.files += %w[README.md License.txt Changelog.md .yardopts .document] +- s.files += %w[README.md LICENSE.md Changelog.md .yardopts .document] - s.test_files = [] - s.rdoc_options = ["--charset=UTF-8"] - s.require_path = "lib" @@ -37,7 +37,7 @@ - s.cert_chain = [File.expand_path('~/.gem/rspec-gem-public_cert.pem')] - end + s.name = "rspec-expectations" -+ s.version = "3.3.0" ++ s.version = "3.4.0" - if RSpec::Expectations::Version::STRING =~ /[a-zA-Z]+/ - # pin to exact version for rc's and betas @@ -45,43 +45,43 @@ + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib"] + s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] -+ s.date = "2015-06-13" ++ s.date = "2016-03-02" + s.description = "rspec-expectations provides a simple, readable API to express expected outcomes of a code example." + s.email = "rspec@googlegroups.com" -+ s.files = [".document", ".yardopts", "Changelog.md", "License.txt", "README.md", "lib/rspec/expectations.rb", "lib/rspec/expectations/configuration.rb", "lib/rspec/expectations/expectation_target.rb", "lib/rspec/expectations/fail_with.rb", "lib/rspec/expectations/failure_aggregator.rb", "lib/rspec/expectations/handler.rb", "lib/rspec/expectations/minitest_integration.rb", "lib/rspec/expectations/syntax.rb", "lib/rspec/expectations/version.rb", "lib/rspec/matchers.rb", "lib/rspec/matchers/aliased_matcher.rb", "lib/rspec/matchers/built_in.rb", "lib/rspec/matchers/built_in/all.rb", "lib/rspec/matchers/built_in/base_matcher.rb", "lib/rspec/matchers/built_in/be.rb", "lib/rspec/matchers/built_in/be_between.rb", "lib/rspec/matchers/built_in/be_instance_of.rb", "lib/rspec/matchers/built_in/be_kind_of.rb", "lib/rspec/matchers/built_in/be_within.rb", "lib/rspec/matchers/built_in/change.rb", "lib/rspec/matchers/built_in/compound.rb", "lib/rspec/matchers/built_in/contain_exactly.rb", "lib/rspec/matchers/built_in/cover.rb", "lib/rspec/matchers/built_in/eq.rb", "lib/rspec/matchers/built_in/eql.rb", "lib/rspec/matchers/built_in/equal.rb", "lib/rspec/matchers/built_in/exist.rb", "lib/rspec/matchers/built_in/has.rb", "lib/rspec/matchers/built_in/have_attributes.rb", "lib/rspec/matchers/built_in/include.rb", "lib/rspec/matchers/built_in/match.rb", "lib/rspec/matchers/built_in/operators.rb", "lib/rspec/matchers/built_in/output.rb", "lib/rspec/matchers/built_in/raise_error.rb", "lib/rspec/matchers/built_in/respond_to.rb", "lib/rspec/matchers/built_in/satisfy.rb", "lib/rspec/matchers/built_in/start_or_end_with.rb", "lib/rspec/matchers/built_in/throw_symbol.rb", "lib/rspec/matchers/built_in/yield.rb", "lib/rspec/matchers/composable.rb", "lib/rspec/matchers/dsl.rb", "lib/rspec/matchers/english_phrasing.rb", "lib/rspec/matchers/expecteds_for_multiple_diffs.rb", "lib/rspec/matchers/fail_matchers.rb", "lib/rspec/matchers/generated_descriptions.rb", "lib/rspec/matchers/matcher_delegator.rb", "lib/rspec/matchers/matcher_protocol.rb", "lib/rspec/matchers/pretty.rb"] ++ s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "lib/rspec/expectations.rb", "lib/rspec/expectations/configuration.rb", "lib/rspec/expectations/expectation_target.rb", "lib/rspec/expectations/fail_with.rb", "lib/rspec/expectations/failure_aggregator.rb", "lib/rspec/expectations/handler.rb", "lib/rspec/expectations/minitest_integration.rb", "lib/rspec/expectations/syntax.rb", "lib/rspec/expectations/version.rb", "lib/rspec/matchers.rb", "lib/rspec/matchers/aliased_matcher.rb", "lib/rspec/matchers/built_in.rb", "lib/rspec/matchers/built_in/all.rb", "lib/rspec/matchers/built_in/base_matcher.rb", "lib/rspec/matchers/built_in/be.rb", "lib/rspec/matchers/built_in/be_between.rb", "lib/rspec/matchers/built_in/be_instance_of.rb", "lib/rspec/matchers/built_in/be_kind_of.rb", "lib/rspec/matchers/built_in/be_within.rb", "lib/rspec/matchers/built_in/change.rb", "lib/rspec/matchers/built_in/compound.rb", "lib/rspec/matchers/built_in/contain_exactly.rb", "lib/rspec/matchers/built_in/cover.rb", "lib/rspec/matchers/built_in/eq.rb", "lib/rspec/matchers/built_in/eql.rb", "lib/rspec/matchers/built_in/equal.rb", "lib/rspec/matchers/built_in/exist.rb", "lib/rspec/matchers/built_in/has.rb", "lib/rspec/matchers/built_in/have_attributes.rb", "lib/rspec/matchers/built_in/include.rb", "lib/rspec/matchers/built_in/match.rb", "lib/rspec/matchers/built_in/operators.rb", "lib/rspec/matchers/built_in/output.rb", "lib/rspec/matchers/built_in/raise_error.rb", "lib/rspec/matchers/built_in/respond_to.rb", "lib/rspec/matchers/built_in/satisfy.rb", "lib/rspec/matchers/built_in/start_or_end_with.rb", "lib/rspec/matchers/built_in/throw_symbol.rb", "lib/rspec/matchers/built_in/yield.rb", "lib/rspec/matchers/composable.rb", "lib/rspec/matchers/dsl.rb", "lib/rspec/matchers/english_phrasing.rb", "lib/rspec/matchers/expecteds_for_multiple_diffs.rb", "lib/rspec/matchers/fail_matchers.rb", "lib/rspec/matchers/generated_descriptions.rb", "lib/rspec/matchers/matcher_delegator.rb", "lib/rspec/matchers/matcher_protocol.rb"] + s.homepage = "http://github.com/rspec/rspec-expectations" + s.licenses = ["MIT"] + s.rdoc_options = ["--charset=UTF-8"] + s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") -+ s.rubygems_version = "2.2.2" -+ s.summary = "rspec-expectations-3.3.0" ++ s.rubygems_version = "2.5.1" ++ s.summary = "rspec-expectations-3.4.0" + + if s.respond_to? :specification_version then + s.specification_version = 4 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then -+ s.add_runtime_dependency(%q, ["~> 3.3.0"]) ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) + s.add_runtime_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_development_dependency(%q, ["~> 10.0.0"]) + s.add_development_dependency(%q, ["~> 1.3"]) -+ s.add_development_dependency(%q, ["~> 0.6"]) ++ s.add_development_dependency(%q, ["~> 0.6.2"]) + s.add_development_dependency(%q, ["~> 5.2"]) + else -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.3"]) -+ s.add_dependency(%q, ["~> 0.6"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) + s.add_dependency(%q, ["~> 5.2"]) + end else - # pin to major/minor ignoring patch - s.add_runtime_dependency "rspec-support", "~> #{RSpec::Expectations::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.3"]) -+ s.add_dependency(%q, ["~> 0.6"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) + s.add_dependency(%q, ["~> 5.2"]) end - @@ -89,7 +89,7 @@ - - s.add_development_dependency 'rake', '~> 10.0.0' - s.add_development_dependency 'cucumber', '~> 1.3' -- s.add_development_dependency "aruba", "~> 0.6" +- s.add_development_dependency "aruba", "~> 0.6.2" # 0.7 is broken on ruby 1.8.7 - s.add_development_dependency 'minitest', '~> 5.2' end --- a/rspec/rspec.gemspec @@ -99,7 +99,7 @@ - -$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) -require "rspec/version" -+# stub: rspec 3.3.0 ruby lib ++# stub: rspec 3.4.0 ruby lib Gem::Specification.new do |s| - s.name = "rspec" @@ -112,10 +112,10 @@ - s.summary = "rspec-#{RSpec::Version::STRING}" - s.description = "BDD for Ruby" + s.name = "rspec" -+ s.version = "3.3.0" ++ s.version = "3.4.0" - s.files = `git ls-files -- lib/*`.split("\n") -- s.files += ["License.txt"] +- s.files += ["LICENSE.md"] - s.test_files = `git ls-files -- {spec,features}/*`.split("\n") - s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } - s.extra_rdoc_files = [ "README.md" ] @@ -124,16 +124,16 @@ + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib"] + s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] -+ s.date = "2015-06-13" ++ s.date = "2016-03-02" + s.description = "BDD for Ruby" + s.email = "rspec@googlegroups.com" + s.extra_rdoc_files = ["README.md"] -+ s.files = ["License.txt", "README.md", "lib/rspec.rb", "lib/rspec/version.rb"] ++ s.files = ["LICENSE.md", "README.md", "lib/rspec.rb", "lib/rspec/version.rb"] + s.homepage = "http://github.com/rspec" + s.licenses = ["MIT"] + s.rdoc_options = ["--charset=UTF-8"] -+ s.rubygems_version = "2.2.2" -+ s.summary = "rspec-3.3.0" ++ s.rubygems_version = "2.5.1" ++ s.summary = "rspec-3.4.0" - private_key = File.expand_path('~/.gem/rspec-gem-private_key.pem') - if File.exist?(private_key) @@ -147,28 +147,28 @@ - if RSpec::Version::STRING =~ /[a-zA-Z]+/ - s.add_runtime_dependency "rspec-#{name}", "= #{RSpec::Version::STRING}" + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then -+ s.add_runtime_dependency(%q, ["~> 3.3.0"]) -+ s.add_runtime_dependency(%q, ["~> 3.3.0"]) -+ s.add_runtime_dependency(%q, ["~> 3.3.0"]) ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) else - s.add_runtime_dependency "rspec-#{name}", "~> #{RSpec::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" -+ s.add_dependency(%q, ["~> 3.3.0"]) -+ s.add_dependency(%q, ["~> 3.3.0"]) -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) end + else -+ s.add_dependency(%q, ["~> 3.3.0"]) -+ s.add_dependency(%q, ["~> 3.3.0"]) -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) end end --- a/rspec-mocks/rspec-mocks.gemspec +++ b/rspec-mocks/rspec-mocks.gemspec -@@ -1,45 +1,49 @@ +@@ -1,44 +1,48 @@ # -*- encoding: utf-8 -*- -$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) -require "rspec/mocks/version" -+# stub: rspec-mocks 3.3.0 ruby lib ++# stub: rspec-mocks 3.4.1 ruby lib Gem::Specification.new do |s| - s.name = "rspec-mocks" @@ -182,7 +182,7 @@ - s.description = "RSpec's 'test double' framework, with support for stubbing and mocking" - - s.files = `git ls-files -- lib/*`.split("\n") -- s.files += %w[README.md License.txt Changelog.md .yardopts .document] +- s.files += %w[README.md LICENSE.md Changelog.md .yardopts .document] - s.test_files = [] - s.rdoc_options = ["--charset=UTF-8"] - s.require_path = "lib" @@ -195,7 +195,7 @@ - s.cert_chain = [File.expand_path('~/.gem/rspec-gem-public_cert.pem')] - end + s.name = "rspec-mocks" -+ s.version = "3.3.0" ++ s.version = "3.4.1" - if RSpec::Mocks::Version::STRING =~ /[a-zA-Z]+/ - # pin to exact version for rc's and betas @@ -203,43 +203,43 @@ + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib"] + s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] -+ s.date = "2015-06-13" ++ s.date = "2016-03-02" + s.description = "RSpec's 'test double' framework, with support for stubbing and mocking" + s.email = "rspec@googlegroups.com" -+ s.files = [".document", ".yardopts", "Changelog.md", "License.txt", "README.md", "lib/rspec/mocks.rb", "lib/rspec/mocks/any_instance.rb", "lib/rspec/mocks/any_instance/chain.rb", "lib/rspec/mocks/any_instance/error_generator.rb", "lib/rspec/mocks/any_instance/expect_chain_chain.rb", "lib/rspec/mocks/any_instance/expectation_chain.rb", "lib/rspec/mocks/any_instance/message_chains.rb", "lib/rspec/mocks/any_instance/proxy.rb", "lib/rspec/mocks/any_instance/recorder.rb", "lib/rspec/mocks/any_instance/stub_chain.rb", "lib/rspec/mocks/any_instance/stub_chain_chain.rb", "lib/rspec/mocks/argument_list_matcher.rb", "lib/rspec/mocks/argument_matchers.rb", "lib/rspec/mocks/configuration.rb", "lib/rspec/mocks/error_generator.rb", "lib/rspec/mocks/example_methods.rb", "lib/rspec/mocks/instance_method_stasher.rb", "lib/rspec/mocks/marshal_extension.rb", "lib/rspec/mocks/matchers/expectation_customization.rb", "lib/rspec/mocks/matchers/have_received.rb", "lib/rspec/mocks/matchers/receive.rb", "lib/rspec/mocks/matchers/receive_message_chain.rb", "lib/rspec/mocks/matchers/receive_messages.rb", "lib/rspec/mocks/message_chain.rb", "lib/rspec/mocks/message_expectation.rb", "lib/rspec/mocks/method_double.rb", "lib/rspec/mocks/method_reference.rb", "lib/rspec/mocks/mutate_const.rb", "lib/rspec/mocks/object_reference.rb", "lib/rspec/mocks/order_group.rb", "lib/rspec/mocks/proxy.rb", "lib/rspec/mocks/space.rb", "lib/rspec/mocks/standalone.rb", "lib/rspec/mocks/syntax.rb", "lib/rspec/mocks/targets.rb", "lib/rspec/mocks/test_double.rb", "lib/rspec/mocks/verifying_double.rb", "lib/rspec/mocks/verifying_message_expecation.rb", "lib/rspec/mocks/verifying_proxy.rb", "lib/rspec/mocks/version.rb"] ++ s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "lib/rspec/mocks.rb", "lib/rspec/mocks/any_instance.rb", "lib/rspec/mocks/any_instance/chain.rb", "lib/rspec/mocks/any_instance/error_generator.rb", "lib/rspec/mocks/any_instance/expect_chain_chain.rb", "lib/rspec/mocks/any_instance/expectation_chain.rb", "lib/rspec/mocks/any_instance/message_chains.rb", "lib/rspec/mocks/any_instance/proxy.rb", "lib/rspec/mocks/any_instance/recorder.rb", "lib/rspec/mocks/any_instance/stub_chain.rb", "lib/rspec/mocks/any_instance/stub_chain_chain.rb", "lib/rspec/mocks/argument_list_matcher.rb", "lib/rspec/mocks/argument_matchers.rb", "lib/rspec/mocks/configuration.rb", "lib/rspec/mocks/error_generator.rb", "lib/rspec/mocks/example_methods.rb", "lib/rspec/mocks/instance_method_stasher.rb", "lib/rspec/mocks/marshal_extension.rb", "lib/rspec/mocks/matchers/expectation_customization.rb", "lib/rspec/mocks/matchers/have_received.rb", "lib/rspec/mocks/matchers/receive.rb", "lib/rspec/mocks/matchers/receive_message_chain.rb", "lib/rspec/mocks/matchers/receive_messages.rb", "lib/rspec/mocks/message_chain.rb", "lib/rspec/mocks/message_expectation.rb", "lib/rspec/mocks/method_double.rb", "lib/rspec/mocks/method_reference.rb", "lib/rspec/mocks/mutate_const.rb", "lib/rspec/mocks/object_reference.rb", "lib/rspec/mocks/order_group.rb", "lib/rspec/mocks/proxy.rb", "lib/rspec/mocks/space.rb", "lib/rspec/mocks/standalone.rb", "lib/rspec/mocks/syntax.rb", "lib/rspec/mocks/targets.rb", "lib/rspec/mocks/test_double.rb", "lib/rspec/mocks/verifying_double.rb", "lib/rspec/mocks/verifying_message_expectation.rb", "lib/rspec/mocks/verifying_proxy.rb", "lib/rspec/mocks/version.rb"] + s.homepage = "http://github.com/rspec/rspec-mocks" + s.licenses = ["MIT"] + s.rdoc_options = ["--charset=UTF-8"] + s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") -+ s.rubygems_version = "2.2.2" -+ s.summary = "rspec-mocks-3.3.0" ++ s.rubygems_version = "2.5.1" ++ s.summary = "rspec-mocks-3.4.1" + + if s.respond_to? :specification_version then + s.specification_version = 4 + + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then -+ s.add_runtime_dependency(%q, ["~> 3.3.0"]) ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) + s.add_runtime_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_development_dependency(%q, ["~> 10.0.0"]) + s.add_development_dependency(%q, ["~> 1.3.15"]) -+ s.add_development_dependency(%q, ["~> 0.5"]) ++ s.add_development_dependency(%q, ["~> 0.6.2"]) + s.add_development_dependency(%q, ["~> 5.2"]) + else -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.3.15"]) -+ s.add_dependency(%q, ["~> 0.5"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) + s.add_dependency(%q, ["~> 5.2"]) + end else - # pin to major/minor ignoring patch - s.add_runtime_dependency "rspec-support", "~> #{RSpec::Mocks::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" -+ s.add_dependency(%q, ["~> 3.3.0"]) ++ s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) + s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.3.15"]) -+ s.add_dependency(%q, ["~> 0.5"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) + s.add_dependency(%q, ["~> 5.2"]) end - @@ -247,19 +247,18 @@ - - s.add_development_dependency 'rake', '~> 10.0.0' - s.add_development_dependency 'cucumber', '~> 1.3.15' -- s.add_development_dependency 'aruba', '~> 0.5' +- s.add_development_dependency 'aruba', '~> 0.6.2' # 0.7 is broken on ruby 1.8.7 - s.add_development_dependency 'minitest', '~> 5.2' - s.add_development_dependency "thread_order", "~> 1.1.0" end --- a/rspec-support/rspec-support.gemspec +++ b/rspec-support/rspec-support.gemspec -@@ -1,32 +1,36 @@ +@@ -1,33 +1,39 @@ -# coding: utf-8 -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'rspec/support/version' +# -*- encoding: utf-8 -*- -+# stub: rspec-support 3.3.0 ruby lib ++# stub: rspec-support 3.4.1 ruby lib -Gem::Specification.new do |spec| - spec.name = "rspec-support" @@ -272,26 +271,26 @@ - spec.license = "MIT" +Gem::Specification.new do |s| + s.name = "rspec-support" -+ s.version = "3.3.0" ++ s.version = "3.4.1" - spec.files = `git ls-files -- lib/*`.split("\n") -- spec.files += %w[README.md LICENSE.txt Changelog.md] +- spec.files += %w[README.md LICENSE.md Changelog.md] - spec.test_files = [] - spec.rdoc_options = ["--charset=UTF-8"] - spec.require_paths = ["lib"] + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.require_paths = ["lib"] + s.authors = ["David Chelimsky", "Myron Marson", "Jon Rowe", "Sam Phippen", "Xaviery Shay", "Bradley Schaefer"] -+ s.date = "2015-06-13" ++ s.date = "2016-03-02" + s.description = "Support utilities for RSpec gems" + s.email = "rspec-users@rubyforge.org" -+ s.files = ["Changelog.md", "LICENSE.txt", "README.md", "lib/rspec/support.rb", "lib/rspec/support/caller_filter.rb", "lib/rspec/support/differ.rb", "lib/rspec/support/directory_maker.rb", "lib/rspec/support/encoded_string.rb", "lib/rspec/support/fuzzy_matcher.rb", "lib/rspec/support/hunk_generator.rb", "lib/rspec/support/matcher_definition.rb", "lib/rspec/support/method_signature_verifier.rb", "lib/rspec/support/object_formatter.rb", "lib/rspec/support/recursive_const_methods.rb", "lib/rspec/support/ruby_features.rb", "lib/rspec/support/spec.rb", "lib/rspec/support/spec/deprecation_helpers.rb", "lib/rspec/support/spec/formatting_support.rb", "lib/rspec/support/spec/in_sub_process.rb", "lib/rspec/support/spec/library_wide_checks.rb", "lib/rspec/support/spec/prevent_load_time_warnings.rb", "lib/rspec/support/spec/shell_out.rb", "lib/rspec/support/spec/stderr_splitter.rb", "lib/rspec/support/spec/string_matcher.rb", "lib/rspec/support/spec/with_isolated_directory.rb", "lib/rspec/support/spec/with_isolated_stderr.rb", "lib/rspec/support/version.rb", "lib/rspec/support/version_checker.rb", "lib/rspec/support/warnings.rb"] ++ s.files = ["Changelog.md", "LICENSE.md", "README.md", "lib/rspec/support.rb", "lib/rspec/support/caller_filter.rb", "lib/rspec/support/comparable_version.rb", "lib/rspec/support/differ.rb", "lib/rspec/support/directory_maker.rb", "lib/rspec/support/encoded_string.rb", "lib/rspec/support/fuzzy_matcher.rb", "lib/rspec/support/hunk_generator.rb", "lib/rspec/support/matcher_definition.rb", "lib/rspec/support/method_signature_verifier.rb", "lib/rspec/support/mutex.rb", "lib/rspec/support/object_formatter.rb", "lib/rspec/support/recursive_const_methods.rb", "lib/rspec/support/reentrant_mutex.rb", "lib/rspec/support/ruby_features.rb", "lib/rspec/support/spec.rb", "lib/rspec/support/spec/deprecation_helpers.rb", "lib/rspec/support/spec/formatting_support.rb", "lib/rspec/support/spec/in_sub_process.rb", "lib/rspec/support/spec/library_wide_checks.rb", "lib/rspec/support/spec/shell_out.rb", "lib/rspec/support/spec/stderr_splitter.rb", "lib/rspec/support/spec/string_matcher.rb", "lib/rspec/support/spec/with_isolated_directory.rb", "lib/rspec/support/spec/with_isolated_stderr.rb", "lib/rspec/support/version.rb", "lib/rspec/support/version_checker.rb", "lib/rspec/support/warnings.rb"] + s.homepage = "https://github.com/rspec/rspec-support" + s.licenses = ["MIT"] + s.rdoc_options = ["--charset=UTF-8"] + s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") -+ s.rubygems_version = "2.2.2" -+ s.summary = "rspec-support-3.3.0" ++ s.rubygems_version = "2.5.1" ++ s.summary = "rspec-support-3.4.1" - private_key = File.expand_path('~/.gem/rspec-gem-private_key.pem') - if File.exist?(private_key) @@ -303,17 +302,130 @@ + if s.respond_to? :specification_version then + s.specification_version = 4 -- spec.add_development_dependency "bundler", "~> 1.3" -- spec.add_development_dependency "rake", "~> 10.0.0" +- spec.add_development_dependency "bundler", "~> 1.3" +- spec.add_development_dependency "rake", "~> 10.0.0" +- spec.add_development_dependency "thread_order", "~> 1.1.0" + if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then + s.add_development_dependency(%q, ["~> 1.3"]) + s.add_development_dependency(%q, ["~> 10.0.0"]) ++ s.add_development_dependency(%q, ["~> 1.1.0"]) + else + s.add_dependency(%q, ["~> 1.3"]) + s.add_dependency(%q, ["~> 10.0.0"]) ++ s.add_dependency(%q, ["~> 1.1.0"]) + end + else + s.add_dependency(%q, ["~> 1.3"]) + s.add_dependency(%q, ["~> 10.0.0"]) ++ s.add_dependency(%q, ["~> 1.1.0"]) + end end +--- a/rspec-core/rspec-core.gemspec ++++ b/rspec-core/rspec-core.gemspec +@@ -1,51 +1,62 @@ + # -*- encoding: utf-8 -*- +-$LOAD_PATH.unshift File.expand_path("../lib", __FILE__) +-require "rspec/core/version" ++# stub: rspec-core 3.4.3 ruby lib + + Gem::Specification.new do |s| +- s.name = "rspec-core" +- s.version = RSpec::Core::Version::STRING +- s.platform = Gem::Platform::RUBY +- s.license = "MIT" +- s.authors = ["Steven Baker", "David Chelimsky", "Chad Humphries", "Myron Marston"] +- s.email = "rspec@googlegroups.com" +- s.homepage = "http://github.com/rspec/rspec-core" +- s.summary = "rspec-core-#{RSpec::Core::Version::STRING}" +- s.description = "BDD for Ruby. RSpec runner and example groups." +- +- s.files = `git ls-files -- lib/*`.split("\n") +- s.files += %w[README.md LICENSE.md Changelog.md .yardopts .document] +- s.test_files = [] +- s.bindir = 'exe' +- s.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) } +- s.rdoc_options = ["--charset=UTF-8"] +- s.require_path = "lib" +- +- s.required_ruby_version = '>= 1.8.7' +- +- private_key = File.expand_path('~/.gem/rspec-gem-private_key.pem') +- if File.exist?(private_key) +- s.signing_key = private_key +- s.cert_chain = [File.expand_path('~/.gem/rspec-gem-public_cert.pem')] +- end ++ s.name = "rspec-core" ++ s.version = "3.4.3" + +- if RSpec::Core::Version::STRING =~ /[a-zA-Z]+/ +- # rspec-support is locked to our version when running pre,rc etc +- s.add_runtime_dependency "rspec-support", "= #{RSpec::Core::Version::STRING}" ++ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= ++ s.require_paths = ["lib"] ++ s.authors = ["Steven Baker", "David Chelimsky", "Chad Humphries", "Myron Marston"] ++ s.bindir = "exe" ++ s.date = "2016-03-02" ++ s.description = "BDD for Ruby. RSpec runner and example groups." ++ s.email = "rspec@googlegroups.com" ++ s.executables = ["rspec"] ++ s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "exe/rspec", "lib/rspec/autorun.rb", "lib/rspec/core.rb", "lib/rspec/core/backtrace_formatter.rb", "lib/rspec/core/bisect/coordinator.rb", "lib/rspec/core/bisect/example_minimizer.rb", "lib/rspec/core/bisect/runner.rb", "lib/rspec/core/bisect/server.rb", "lib/rspec/core/configuration.rb", "lib/rspec/core/configuration_options.rb", "lib/rspec/core/drb.rb", "lib/rspec/core/dsl.rb", "lib/rspec/core/example.rb", "lib/rspec/core/example_group.rb", "lib/rspec/core/example_status_persister.rb", "lib/rspec/core/filter_manager.rb", "lib/rspec/core/flat_map.rb", "lib/rspec/core/formatters.rb", "lib/rspec/core/formatters/base_formatter.rb", "lib/rspec/core/formatters/base_text_formatter.rb", "lib/rspec/core/formatters/bisect_formatter.rb", "lib/rspec/core/formatters/bisect_progress_formatter.rb", "lib/rspec/core/formatters/console_codes.rb", "lib/rspec/core/formatters/deprecation_formatter.rb", "lib/rspec/core/formatters/documentation_formatter.rb", "lib/rspec/core/formatters/exception_presenter.rb", "lib/rspec/core/formatters/fallback_message_formatter.rb", "lib/rspec/core/formatters/helpers.rb", "lib/rspec/core/formatters/html_formatter.rb", "lib/rspec/core/formatters/html_printer.rb", "lib/rspec/core/formatters/html_snippet_extractor.rb", "lib/rspec/core/formatters/json_formatter.rb", "lib/rspec/core/formatters/profile_formatter.rb", "lib/rspec/core/formatters/progress_formatter.rb", "lib/rspec/core/formatters/protocol.rb", "lib/rspec/core/formatters/snippet_extractor.rb", "lib/rspec/core/hooks.rb", "lib/rspec/core/memoized_helpers.rb", "lib/rspec/core/metadata.rb", "lib/rspec/core/metadata_filter.rb", "lib/rspec/core/minitest_assertions_adapter.rb", "lib/rspec/core/mocking_adapters/flexmock.rb", "lib/rspec/core/mocking_adapters/mocha.rb", "lib/rspec/core/mocking_adapters/null.rb", "lib/rspec/core/mocking_adapters/rr.rb", "lib/rspec/core/mocking_adapters/rspec.rb", "lib/rspec/core/notifications.rb", "lib/rspec/core/option_parser.rb", "lib/rspec/core/ordering.rb", "lib/rspec/core/pending.rb", "lib/rspec/core/profiler.rb", "lib/rspec/core/project_initializer.rb", "lib/rspec/core/project_initializer/.rspec", "lib/rspec/core/project_initializer/spec/spec_helper.rb", "lib/rspec/core/rake_task.rb", "lib/rspec/core/reporter.rb", "lib/rspec/core/ruby_project.rb", "lib/rspec/core/runner.rb", "lib/rspec/core/sandbox.rb", "lib/rspec/core/set.rb", "lib/rspec/core/shared_context.rb", "lib/rspec/core/shared_example_group.rb", "lib/rspec/core/shell_escape.rb", "lib/rspec/core/source.rb", "lib/rspec/core/source/location.rb", "lib/rspec/core/source/node.rb", "lib/rspec/core/source/syntax_highlighter.rb", "lib/rspec/core/source/token.rb", "lib/rspec/core/test_unit_assertions_adapter.rb", "lib/rspec/core/version.rb", "lib/rspec/core/warnings.rb", "lib/rspec/core/world.rb"] ++ s.homepage = "http://github.com/rspec/rspec-core" ++ s.licenses = ["MIT"] ++ s.rdoc_options = ["--charset=UTF-8"] ++ s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") ++ s.rubygems_version = "2.5.1" ++ s.summary = "rspec-core-3.4.3" ++ ++ if s.respond_to? :specification_version then ++ s.specification_version = 4 ++ ++ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then ++ s.add_runtime_dependency(%q, ["~> 3.4.0"]) ++ s.add_development_dependency(%q, ["~> 10.0.0"]) ++ s.add_development_dependency(%q, ["~> 1.3"]) ++ s.add_development_dependency(%q, ["~> 5.3"]) ++ s.add_development_dependency(%q, ["~> 0.6.2"]) ++ s.add_development_dependency(%q, ["~> 1.0.9"]) ++ s.add_development_dependency(%q, ["~> 0.13.0"]) ++ s.add_development_dependency(%q, ["~> 1.0.4"]) ++ s.add_development_dependency(%q, ["~> 0.9.0"]) ++ s.add_development_dependency(%q, ["~> 1.1.0"]) ++ else ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 10.0.0"]) ++ s.add_dependency(%q, ["~> 1.3"]) ++ s.add_dependency(%q, ["~> 5.3"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) ++ s.add_dependency(%q, ["~> 1.0.9"]) ++ s.add_dependency(%q, ["~> 0.13.0"]) ++ s.add_dependency(%q, ["~> 1.0.4"]) ++ s.add_dependency(%q, ["~> 0.9.0"]) ++ s.add_dependency(%q, ["~> 1.1.0"]) ++ end + else +- # rspec-support must otherwise match our major/minor version +- s.add_runtime_dependency "rspec-support", "~> #{RSpec::Core::Version::STRING.split('.')[0..1].concat(['0']).join('.')}" ++ s.add_dependency(%q, ["~> 3.4.0"]) ++ s.add_dependency(%q, ["~> 10.0.0"]) ++ s.add_dependency(%q, ["~> 1.3"]) ++ s.add_dependency(%q, ["~> 5.3"]) ++ s.add_dependency(%q, ["~> 0.6.2"]) ++ s.add_dependency(%q, ["~> 1.0.9"]) ++ s.add_dependency(%q, ["~> 0.13.0"]) ++ s.add_dependency(%q, ["~> 1.0.4"]) ++ s.add_dependency(%q, ["~> 0.9.0"]) ++ s.add_dependency(%q, ["~> 1.1.0"]) + end +- +- s.add_development_dependency "rake", "~> 10.0.0" +- s.add_development_dependency "cucumber", "~> 1.3" +- s.add_development_dependency "minitest", "~> 5.3" +- s.add_development_dependency "aruba", "~> 0.6.2" # 0.7 is broken on ruby 1.8.7 +- +- s.add_development_dependency "coderay", "~> 1.0.9" +- +- s.add_development_dependency "mocha", "~> 0.13.0" +- s.add_development_dependency "rr", "~> 1.0.4" +- s.add_development_dependency "flexmock", "~> 0.9.0" +- s.add_development_dependency "thread_order", "~> 1.1.0" + end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/patches/series ruby-rspec-3.4.0c3e0m1s1/debian/patches/series --- ruby-rspec-3.3.0c2e1m2s0/debian/patches/series 2015-06-15 05:47:42.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/patches/series 2016-03-02 17:51:24.000000000 +0000 @@ -3,11 +3,12 @@ disable_specs_assuming_they_are_first_caller.patch path_to_executable.patch skip_coverage.patch -escape-path-in-match.patch caller_filter_spec_for_debian.patch fix_encoding.patch #no-aruba.patch disable_no_warning_spec_rspec-support.patch fix-rake-task.patch -autorun-load-configuration.patch +#escape-path-in-match.patch +#autorun-load-configuration.patch failed_specs.patch +disable_coderay_highlight_specs.patch diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rspec-core.gemspec ruby-rspec-3.4.0c3e0m1s1/debian/rspec-core.gemspec --- ruby-rspec-3.3.0c2e1m2s0/debian/rspec-core.gemspec 2015-07-27 06:14:44.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rspec-core.gemspec 2016-03-02 13:48:21.000000000 +0000 @@ -1,48 +1,46 @@ # -*- encoding: utf-8 -*- -# stub: rspec-core 3.3.2 ruby lib +# stub: rspec-core 3.4.3 ruby lib Gem::Specification.new do |s| s.name = "rspec-core" - s.version = "3.3.2" + s.version = "3.4.3" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Steven Baker", "David Chelimsky", "Chad Humphries", "Myron Marston"] s.bindir = "exe" - s.date = "2015-07-27" + s.date = "2016-03-02" s.description = "BDD for Ruby. RSpec runner and example groups." s.email = "rspec@googlegroups.com" s.executables = ["rspec"] - s.files = [".document", ".yardopts", "Changelog.md", "License.txt", "README.md", "exe/rspec", "lib/rspec/autorun.rb", "lib/rspec/core.rb", "lib/rspec/core/backtrace_formatter.rb", "lib/rspec/core/bisect/coordinator.rb", "lib/rspec/core/bisect/example_minimizer.rb", "lib/rspec/core/bisect/runner.rb", "lib/rspec/core/bisect/server.rb", "lib/rspec/core/bisect/subset_enumerator.rb", "lib/rspec/core/configuration.rb", "lib/rspec/core/configuration_options.rb", "lib/rspec/core/drb.rb", "lib/rspec/core/dsl.rb", "lib/rspec/core/example.rb", "lib/rspec/core/example_group.rb", "lib/rspec/core/example_status_persister.rb", "lib/rspec/core/filter_manager.rb", "lib/rspec/core/flat_map.rb", "lib/rspec/core/formatters.rb", "lib/rspec/core/formatters/base_formatter.rb", "lib/rspec/core/formatters/base_text_formatter.rb", "lib/rspec/core/formatters/bisect_formatter.rb", "lib/rspec/core/formatters/bisect_progress_formatter.rb", "lib/rspec/core/formatters/console_codes.rb", "lib/rspec/core/formatters/deprecation_formatter.rb", "lib/rspec/core/formatters/documentation_formatter.rb", "lib/rspec/core/formatters/exception_presenter.rb", "lib/rspec/core/formatters/fallback_message_formatter.rb", "lib/rspec/core/formatters/helpers.rb", "lib/rspec/core/formatters/html_formatter.rb", "lib/rspec/core/formatters/html_printer.rb", "lib/rspec/core/formatters/json_formatter.rb", "lib/rspec/core/formatters/profile_formatter.rb", "lib/rspec/core/formatters/progress_formatter.rb", "lib/rspec/core/formatters/protocol.rb", "lib/rspec/core/formatters/snippet_extractor.rb", "lib/rspec/core/hooks.rb", "lib/rspec/core/memoized_helpers.rb", "lib/rspec/core/metadata.rb", "lib/rspec/core/metadata_filter.rb", "lib/rspec/core/minitest_assertions_adapter.rb", "lib/rspec/core/mocking_adapters/flexmock.rb", "lib/rspec/core/mocking_adapters/mocha.rb", "lib/rspec/core/mocking_adapters/null.rb", "lib/rspec/core/mocking_adapters/rr.rb", "lib/rspec/core/mocking_adapters/rspec.rb", "lib/rspec/core/mutex.rb", "lib/rspec/core/notifications.rb", "lib/rspec/core/option_parser.rb", "lib/rspec/core/ordering.rb", "lib/rspec/core/pending.rb", "lib/rspec/core/profiler.rb", "lib/rspec/core/project_initializer.rb", "lib/rspec/core/project_initializer/.rspec", "lib/rspec/core/project_initializer/spec/spec_helper.rb", "lib/rspec/core/rake_task.rb", "lib/rspec/core/reentrant_mutex.rb", "lib/rspec/core/reporter.rb", "lib/rspec/core/ruby_project.rb", "lib/rspec/core/runner.rb", "lib/rspec/core/sandbox.rb", "lib/rspec/core/set.rb", "lib/rspec/core/shared_context.rb", "lib/rspec/core/shared_example_group.rb", "lib/rspec/core/shell_escape.rb", "lib/rspec/core/test_unit_assertions_adapter.rb", "lib/rspec/core/version.rb", "lib/rspec/core/warnings.rb", "lib/rspec/core/world.rb"] + s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "exe/rspec", "lib/rspec/autorun.rb", "lib/rspec/core.rb", "lib/rspec/core/backtrace_formatter.rb", "lib/rspec/core/bisect/coordinator.rb", "lib/rspec/core/bisect/example_minimizer.rb", "lib/rspec/core/bisect/runner.rb", "lib/rspec/core/bisect/server.rb", "lib/rspec/core/configuration.rb", "lib/rspec/core/configuration_options.rb", "lib/rspec/core/drb.rb", "lib/rspec/core/dsl.rb", "lib/rspec/core/example.rb", "lib/rspec/core/example_group.rb", "lib/rspec/core/example_status_persister.rb", "lib/rspec/core/filter_manager.rb", "lib/rspec/core/flat_map.rb", "lib/rspec/core/formatters.rb", "lib/rspec/core/formatters/base_formatter.rb", "lib/rspec/core/formatters/base_text_formatter.rb", "lib/rspec/core/formatters/bisect_formatter.rb", "lib/rspec/core/formatters/bisect_progress_formatter.rb", "lib/rspec/core/formatters/console_codes.rb", "lib/rspec/core/formatters/deprecation_formatter.rb", "lib/rspec/core/formatters/documentation_formatter.rb", "lib/rspec/core/formatters/exception_presenter.rb", "lib/rspec/core/formatters/fallback_message_formatter.rb", "lib/rspec/core/formatters/helpers.rb", "lib/rspec/core/formatters/html_formatter.rb", "lib/rspec/core/formatters/html_printer.rb", "lib/rspec/core/formatters/html_snippet_extractor.rb", "lib/rspec/core/formatters/json_formatter.rb", "lib/rspec/core/formatters/profile_formatter.rb", "lib/rspec/core/formatters/progress_formatter.rb", "lib/rspec/core/formatters/protocol.rb", "lib/rspec/core/formatters/snippet_extractor.rb", "lib/rspec/core/hooks.rb", "lib/rspec/core/memoized_helpers.rb", "lib/rspec/core/metadata.rb", "lib/rspec/core/metadata_filter.rb", "lib/rspec/core/minitest_assertions_adapter.rb", "lib/rspec/core/mocking_adapters/flexmock.rb", "lib/rspec/core/mocking_adapters/mocha.rb", "lib/rspec/core/mocking_adapters/null.rb", "lib/rspec/core/mocking_adapters/rr.rb", "lib/rspec/core/mocking_adapters/rspec.rb", "lib/rspec/core/notifications.rb", "lib/rspec/core/option_parser.rb", "lib/rspec/core/ordering.rb", "lib/rspec/core/pending.rb", "lib/rspec/core/profiler.rb", "lib/rspec/core/project_initializer.rb", "lib/rspec/core/project_initializer/.rspec", "lib/rspec/core/project_initializer/spec/spec_helper.rb", "lib/rspec/core/rake_task.rb", "lib/rspec/core/reporter.rb", "lib/rspec/core/ruby_project.rb", "lib/rspec/core/runner.rb", "lib/rspec/core/sandbox.rb", "lib/rspec/core/set.rb", "lib/rspec/core/shared_context.rb", "lib/rspec/core/shared_example_group.rb", "lib/rspec/core/shell_escape.rb", "lib/rspec/core/source.rb", "lib/rspec/core/source/location.rb", "lib/rspec/core/source/node.rb", "lib/rspec/core/source/syntax_highlighter.rb", "lib/rspec/core/source/token.rb", "lib/rspec/core/test_unit_assertions_adapter.rb", "lib/rspec/core/version.rb", "lib/rspec/core/warnings.rb", "lib/rspec/core/world.rb"] s.homepage = "http://github.com/rspec/rspec-core" s.licenses = ["MIT"] s.rdoc_options = ["--charset=UTF-8"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") - s.rubygems_version = "2.2.2" - s.summary = "rspec-core-3.3.2" + s.rubygems_version = "2.5.1" + s.summary = "rspec-core-3.4.3" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, ["~> 3.3.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) s.add_development_dependency(%q, ["~> 10.0.0"]) s.add_development_dependency(%q, ["~> 1.3"]) s.add_development_dependency(%q, ["~> 5.3"]) s.add_development_dependency(%q, ["~> 0.6.2"]) - s.add_development_dependency(%q, ["~> 1.5"]) s.add_development_dependency(%q, ["~> 1.0.9"]) s.add_development_dependency(%q, ["~> 0.13.0"]) s.add_development_dependency(%q, ["~> 1.0.4"]) s.add_development_dependency(%q, ["~> 0.9.0"]) s.add_development_dependency(%q, ["~> 1.1.0"]) else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3"]) s.add_dependency(%q, ["~> 5.3"]) s.add_dependency(%q, ["~> 0.6.2"]) - s.add_dependency(%q, ["~> 1.5"]) s.add_dependency(%q, ["~> 1.0.9"]) s.add_dependency(%q, ["~> 0.13.0"]) s.add_dependency(%q, ["~> 1.0.4"]) @@ -50,12 +48,11 @@ s.add_dependency(%q, ["~> 1.1.0"]) end else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3"]) s.add_dependency(%q, ["~> 5.3"]) s.add_dependency(%q, ["~> 0.6.2"]) - s.add_dependency(%q, ["~> 1.5"]) s.add_dependency(%q, ["~> 1.0.9"]) s.add_dependency(%q, ["~> 0.13.0"]) s.add_dependency(%q, ["~> 1.0.4"]) diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rspec-expectations.gemspec ruby-rspec-3.4.0c3e0m1s1/debian/rspec-expectations.gemspec --- ruby-rspec-3.3.0c2e1m2s0/debian/rspec-expectations.gemspec 2015-07-27 06:14:44.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rspec-expectations.gemspec 2016-03-02 13:48:21.000000000 +0000 @@ -1,48 +1,48 @@ # -*- encoding: utf-8 -*- -# stub: rspec-expectations 3.3.0 ruby lib +# stub: rspec-expectations 3.4.0 ruby lib Gem::Specification.new do |s| s.name = "rspec-expectations" - s.version = "3.3.0" + s.version = "3.4.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] - s.date = "2015-06-13" + s.date = "2016-03-02" s.description = "rspec-expectations provides a simple, readable API to express expected outcomes of a code example." s.email = "rspec@googlegroups.com" - s.files = [".document", ".yardopts", "Changelog.md", "License.txt", "README.md", "lib/rspec/expectations.rb", "lib/rspec/expectations/configuration.rb", "lib/rspec/expectations/expectation_target.rb", "lib/rspec/expectations/fail_with.rb", "lib/rspec/expectations/failure_aggregator.rb", "lib/rspec/expectations/handler.rb", "lib/rspec/expectations/minitest_integration.rb", "lib/rspec/expectations/syntax.rb", "lib/rspec/expectations/version.rb", "lib/rspec/matchers.rb", "lib/rspec/matchers/aliased_matcher.rb", "lib/rspec/matchers/built_in.rb", "lib/rspec/matchers/built_in/all.rb", "lib/rspec/matchers/built_in/base_matcher.rb", "lib/rspec/matchers/built_in/be.rb", "lib/rspec/matchers/built_in/be_between.rb", "lib/rspec/matchers/built_in/be_instance_of.rb", "lib/rspec/matchers/built_in/be_kind_of.rb", "lib/rspec/matchers/built_in/be_within.rb", "lib/rspec/matchers/built_in/change.rb", "lib/rspec/matchers/built_in/compound.rb", "lib/rspec/matchers/built_in/contain_exactly.rb", "lib/rspec/matchers/built_in/cover.rb", "lib/rspec/matchers/built_in/eq.rb", "lib/rspec/matchers/built_in/eql.rb", "lib/rspec/matchers/built_in/equal.rb", "lib/rspec/matchers/built_in/exist.rb", "lib/rspec/matchers/built_in/has.rb", "lib/rspec/matchers/built_in/have_attributes.rb", "lib/rspec/matchers/built_in/include.rb", "lib/rspec/matchers/built_in/match.rb", "lib/rspec/matchers/built_in/operators.rb", "lib/rspec/matchers/built_in/output.rb", "lib/rspec/matchers/built_in/raise_error.rb", "lib/rspec/matchers/built_in/respond_to.rb", "lib/rspec/matchers/built_in/satisfy.rb", "lib/rspec/matchers/built_in/start_or_end_with.rb", "lib/rspec/matchers/built_in/throw_symbol.rb", "lib/rspec/matchers/built_in/yield.rb", "lib/rspec/matchers/composable.rb", "lib/rspec/matchers/dsl.rb", "lib/rspec/matchers/english_phrasing.rb", "lib/rspec/matchers/expecteds_for_multiple_diffs.rb", "lib/rspec/matchers/fail_matchers.rb", "lib/rspec/matchers/generated_descriptions.rb", "lib/rspec/matchers/matcher_delegator.rb", "lib/rspec/matchers/matcher_protocol.rb", "lib/rspec/matchers/pretty.rb"] + s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "lib/rspec/expectations.rb", "lib/rspec/expectations/configuration.rb", "lib/rspec/expectations/expectation_target.rb", "lib/rspec/expectations/fail_with.rb", "lib/rspec/expectations/failure_aggregator.rb", "lib/rspec/expectations/handler.rb", "lib/rspec/expectations/minitest_integration.rb", "lib/rspec/expectations/syntax.rb", "lib/rspec/expectations/version.rb", "lib/rspec/matchers.rb", "lib/rspec/matchers/aliased_matcher.rb", "lib/rspec/matchers/built_in.rb", "lib/rspec/matchers/built_in/all.rb", "lib/rspec/matchers/built_in/base_matcher.rb", "lib/rspec/matchers/built_in/be.rb", "lib/rspec/matchers/built_in/be_between.rb", "lib/rspec/matchers/built_in/be_instance_of.rb", "lib/rspec/matchers/built_in/be_kind_of.rb", "lib/rspec/matchers/built_in/be_within.rb", "lib/rspec/matchers/built_in/change.rb", "lib/rspec/matchers/built_in/compound.rb", "lib/rspec/matchers/built_in/contain_exactly.rb", "lib/rspec/matchers/built_in/cover.rb", "lib/rspec/matchers/built_in/eq.rb", "lib/rspec/matchers/built_in/eql.rb", "lib/rspec/matchers/built_in/equal.rb", "lib/rspec/matchers/built_in/exist.rb", "lib/rspec/matchers/built_in/has.rb", "lib/rspec/matchers/built_in/have_attributes.rb", "lib/rspec/matchers/built_in/include.rb", "lib/rspec/matchers/built_in/match.rb", "lib/rspec/matchers/built_in/operators.rb", "lib/rspec/matchers/built_in/output.rb", "lib/rspec/matchers/built_in/raise_error.rb", "lib/rspec/matchers/built_in/respond_to.rb", "lib/rspec/matchers/built_in/satisfy.rb", "lib/rspec/matchers/built_in/start_or_end_with.rb", "lib/rspec/matchers/built_in/throw_symbol.rb", "lib/rspec/matchers/built_in/yield.rb", "lib/rspec/matchers/composable.rb", "lib/rspec/matchers/dsl.rb", "lib/rspec/matchers/english_phrasing.rb", "lib/rspec/matchers/expecteds_for_multiple_diffs.rb", "lib/rspec/matchers/fail_matchers.rb", "lib/rspec/matchers/generated_descriptions.rb", "lib/rspec/matchers/matcher_delegator.rb", "lib/rspec/matchers/matcher_protocol.rb"] s.homepage = "http://github.com/rspec/rspec-expectations" s.licenses = ["MIT"] s.rdoc_options = ["--charset=UTF-8"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") - s.rubygems_version = "2.2.2" - s.summary = "rspec-expectations-3.3.0" + s.rubygems_version = "2.5.1" + s.summary = "rspec-expectations-3.4.0" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, ["~> 3.3.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) s.add_runtime_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_development_dependency(%q, ["~> 10.0.0"]) s.add_development_dependency(%q, ["~> 1.3"]) - s.add_development_dependency(%q, ["~> 0.6"]) + s.add_development_dependency(%q, ["~> 0.6.2"]) s.add_development_dependency(%q, ["~> 5.2"]) else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3"]) - s.add_dependency(%q, ["~> 0.6"]) + s.add_dependency(%q, ["~> 0.6.2"]) s.add_dependency(%q, ["~> 5.2"]) end else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3"]) - s.add_dependency(%q, ["~> 0.6"]) + s.add_dependency(%q, ["~> 0.6.2"]) s.add_dependency(%q, ["~> 5.2"]) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rspec.gemspec ruby-rspec-3.4.0c3e0m1s1/debian/rspec.gemspec --- ruby-rspec-3.3.0c2e1m2s0/debian/rspec.gemspec 2015-07-27 06:14:43.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rspec.gemspec 2016-03-02 13:48:21.000000000 +0000 @@ -1,39 +1,39 @@ # -*- encoding: utf-8 -*- -# stub: rspec 3.3.0 ruby lib +# stub: rspec 3.4.0 ruby lib Gem::Specification.new do |s| s.name = "rspec" - s.version = "3.3.0" + s.version = "3.4.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] - s.date = "2015-06-13" + s.date = "2016-03-02" s.description = "BDD for Ruby" s.email = "rspec@googlegroups.com" s.extra_rdoc_files = ["README.md"] - s.files = ["License.txt", "README.md", "lib/rspec.rb", "lib/rspec/version.rb"] + s.files = ["LICENSE.md", "README.md", "lib/rspec.rb", "lib/rspec/version.rb"] s.homepage = "http://github.com/rspec" s.licenses = ["MIT"] s.rdoc_options = ["--charset=UTF-8"] - s.rubygems_version = "2.2.2" - s.summary = "rspec-3.3.0" + s.rubygems_version = "2.5.1" + s.summary = "rspec-3.4.0" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, ["~> 3.3.0"]) - s.add_runtime_dependency(%q, ["~> 3.3.0"]) - s.add_runtime_dependency(%q, ["~> 3.3.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) else - s.add_dependency(%q, ["~> 3.3.0"]) - s.add_dependency(%q, ["~> 3.3.0"]) - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) end else - s.add_dependency(%q, ["~> 3.3.0"]) - s.add_dependency(%q, ["~> 3.3.0"]) - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rspec-mocks.gemspec ruby-rspec-3.4.0c3e0m1s1/debian/rspec-mocks.gemspec --- ruby-rspec-3.3.0c2e1m2s0/debian/rspec-mocks.gemspec 2015-07-27 06:14:44.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rspec-mocks.gemspec 2016-03-02 13:48:21.000000000 +0000 @@ -1,51 +1,48 @@ # -*- encoding: utf-8 -*- -# stub: rspec-mocks 3.3.0 ruby lib +# stub: rspec-mocks 3.4.1 ruby lib Gem::Specification.new do |s| s.name = "rspec-mocks" - s.version = "3.3.0" + s.version = "3.4.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Steven Baker", "David Chelimsky", "Myron Marston"] - s.date = "2015-06-13" + s.date = "2016-03-02" s.description = "RSpec's 'test double' framework, with support for stubbing and mocking" s.email = "rspec@googlegroups.com" - s.files = [".document", ".yardopts", "Changelog.md", "License.txt", "README.md", "lib/rspec/mocks.rb", "lib/rspec/mocks/any_instance.rb", "lib/rspec/mocks/any_instance/chain.rb", "lib/rspec/mocks/any_instance/error_generator.rb", "lib/rspec/mocks/any_instance/expect_chain_chain.rb", "lib/rspec/mocks/any_instance/expectation_chain.rb", "lib/rspec/mocks/any_instance/message_chains.rb", "lib/rspec/mocks/any_instance/proxy.rb", "lib/rspec/mocks/any_instance/recorder.rb", "lib/rspec/mocks/any_instance/stub_chain.rb", "lib/rspec/mocks/any_instance/stub_chain_chain.rb", "lib/rspec/mocks/argument_list_matcher.rb", "lib/rspec/mocks/argument_matchers.rb", "lib/rspec/mocks/configuration.rb", "lib/rspec/mocks/error_generator.rb", "lib/rspec/mocks/example_methods.rb", "lib/rspec/mocks/instance_method_stasher.rb", "lib/rspec/mocks/marshal_extension.rb", "lib/rspec/mocks/matchers/expectation_customization.rb", "lib/rspec/mocks/matchers/have_received.rb", "lib/rspec/mocks/matchers/receive.rb", "lib/rspec/mocks/matchers/receive_message_chain.rb", "lib/rspec/mocks/matchers/receive_messages.rb", "lib/rspec/mocks/message_chain.rb", "lib/rspec/mocks/message_expectation.rb", "lib/rspec/mocks/method_double.rb", "lib/rspec/mocks/method_reference.rb", "lib/rspec/mocks/mutate_const.rb", "lib/rspec/mocks/object_reference.rb", "lib/rspec/mocks/order_group.rb", "lib/rspec/mocks/proxy.rb", "lib/rspec/mocks/space.rb", "lib/rspec/mocks/standalone.rb", "lib/rspec/mocks/syntax.rb", "lib/rspec/mocks/targets.rb", "lib/rspec/mocks/test_double.rb", "lib/rspec/mocks/verifying_double.rb", "lib/rspec/mocks/verifying_message_expecation.rb", "lib/rspec/mocks/verifying_proxy.rb", "lib/rspec/mocks/version.rb"] + s.files = [".document", ".yardopts", "Changelog.md", "LICENSE.md", "README.md", "lib/rspec/mocks.rb", "lib/rspec/mocks/any_instance.rb", "lib/rspec/mocks/any_instance/chain.rb", "lib/rspec/mocks/any_instance/error_generator.rb", "lib/rspec/mocks/any_instance/expect_chain_chain.rb", "lib/rspec/mocks/any_instance/expectation_chain.rb", "lib/rspec/mocks/any_instance/message_chains.rb", "lib/rspec/mocks/any_instance/proxy.rb", "lib/rspec/mocks/any_instance/recorder.rb", "lib/rspec/mocks/any_instance/stub_chain.rb", "lib/rspec/mocks/any_instance/stub_chain_chain.rb", "lib/rspec/mocks/argument_list_matcher.rb", "lib/rspec/mocks/argument_matchers.rb", "lib/rspec/mocks/configuration.rb", "lib/rspec/mocks/error_generator.rb", "lib/rspec/mocks/example_methods.rb", "lib/rspec/mocks/instance_method_stasher.rb", "lib/rspec/mocks/marshal_extension.rb", "lib/rspec/mocks/matchers/expectation_customization.rb", "lib/rspec/mocks/matchers/have_received.rb", "lib/rspec/mocks/matchers/receive.rb", "lib/rspec/mocks/matchers/receive_message_chain.rb", "lib/rspec/mocks/matchers/receive_messages.rb", "lib/rspec/mocks/message_chain.rb", "lib/rspec/mocks/message_expectation.rb", "lib/rspec/mocks/method_double.rb", "lib/rspec/mocks/method_reference.rb", "lib/rspec/mocks/mutate_const.rb", "lib/rspec/mocks/object_reference.rb", "lib/rspec/mocks/order_group.rb", "lib/rspec/mocks/proxy.rb", "lib/rspec/mocks/space.rb", "lib/rspec/mocks/standalone.rb", "lib/rspec/mocks/syntax.rb", "lib/rspec/mocks/targets.rb", "lib/rspec/mocks/test_double.rb", "lib/rspec/mocks/verifying_double.rb", "lib/rspec/mocks/verifying_message_expectation.rb", "lib/rspec/mocks/verifying_proxy.rb", "lib/rspec/mocks/version.rb"] s.homepage = "http://github.com/rspec/rspec-mocks" s.licenses = ["MIT"] s.rdoc_options = ["--charset=UTF-8"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") - s.rubygems_version = "2.2.2" - s.summary = "rspec-mocks-3.3.0" + s.rubygems_version = "2.5.1" + s.summary = "rspec-mocks-3.4.1" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, ["~> 3.3.0"]) + s.add_runtime_dependency(%q, ["~> 3.4.0"]) s.add_runtime_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_development_dependency(%q, ["~> 10.0.0"]) s.add_development_dependency(%q, ["~> 1.3.15"]) - s.add_development_dependency(%q, ["~> 0.5"]) + s.add_development_dependency(%q, ["~> 0.6.2"]) s.add_development_dependency(%q, ["~> 5.2"]) - s.add_development_dependency(%q, ["~> 1.1.0"]) else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3.15"]) - s.add_dependency(%q, ["~> 0.5"]) + s.add_dependency(%q, ["~> 0.6.2"]) s.add_dependency(%q, ["~> 5.2"]) - s.add_dependency(%q, ["~> 1.1.0"]) end else - s.add_dependency(%q, ["~> 3.3.0"]) + s.add_dependency(%q, ["~> 3.4.0"]) s.add_dependency(%q, ["< 2.0", ">= 1.2.0"]) s.add_dependency(%q, ["~> 10.0.0"]) s.add_dependency(%q, ["~> 1.3.15"]) - s.add_dependency(%q, ["~> 0.5"]) + s.add_dependency(%q, ["~> 0.6.2"]) s.add_dependency(%q, ["~> 5.2"]) - s.add_dependency(%q, ["~> 1.1.0"]) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rspec-support.gemspec ruby-rspec-3.4.0c3e0m1s1/debian/rspec-support.gemspec --- ruby-rspec-3.3.0c2e1m2s0/debian/rspec-support.gemspec 2015-07-27 06:14:44.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rspec-support.gemspec 2016-03-02 13:48:21.000000000 +0000 @@ -1,23 +1,23 @@ # -*- encoding: utf-8 -*- -# stub: rspec-support 3.3.0 ruby lib +# stub: rspec-support 3.4.1 ruby lib Gem::Specification.new do |s| s.name = "rspec-support" - s.version = "3.3.0" + s.version = "3.4.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["David Chelimsky", "Myron Marson", "Jon Rowe", "Sam Phippen", "Xaviery Shay", "Bradley Schaefer"] - s.date = "2015-06-13" + s.date = "2016-03-02" s.description = "Support utilities for RSpec gems" s.email = "rspec-users@rubyforge.org" - s.files = ["Changelog.md", "LICENSE.txt", "README.md", "lib/rspec/support.rb", "lib/rspec/support/caller_filter.rb", "lib/rspec/support/differ.rb", "lib/rspec/support/directory_maker.rb", "lib/rspec/support/encoded_string.rb", "lib/rspec/support/fuzzy_matcher.rb", "lib/rspec/support/hunk_generator.rb", "lib/rspec/support/matcher_definition.rb", "lib/rspec/support/method_signature_verifier.rb", "lib/rspec/support/object_formatter.rb", "lib/rspec/support/recursive_const_methods.rb", "lib/rspec/support/ruby_features.rb", "lib/rspec/support/spec.rb", "lib/rspec/support/spec/deprecation_helpers.rb", "lib/rspec/support/spec/formatting_support.rb", "lib/rspec/support/spec/in_sub_process.rb", "lib/rspec/support/spec/library_wide_checks.rb", "lib/rspec/support/spec/prevent_load_time_warnings.rb", "lib/rspec/support/spec/shell_out.rb", "lib/rspec/support/spec/stderr_splitter.rb", "lib/rspec/support/spec/string_matcher.rb", "lib/rspec/support/spec/with_isolated_directory.rb", "lib/rspec/support/spec/with_isolated_stderr.rb", "lib/rspec/support/version.rb", "lib/rspec/support/version_checker.rb", "lib/rspec/support/warnings.rb"] + s.files = ["Changelog.md", "LICENSE.md", "README.md", "lib/rspec/support.rb", "lib/rspec/support/caller_filter.rb", "lib/rspec/support/comparable_version.rb", "lib/rspec/support/differ.rb", "lib/rspec/support/directory_maker.rb", "lib/rspec/support/encoded_string.rb", "lib/rspec/support/fuzzy_matcher.rb", "lib/rspec/support/hunk_generator.rb", "lib/rspec/support/matcher_definition.rb", "lib/rspec/support/method_signature_verifier.rb", "lib/rspec/support/mutex.rb", "lib/rspec/support/object_formatter.rb", "lib/rspec/support/recursive_const_methods.rb", "lib/rspec/support/reentrant_mutex.rb", "lib/rspec/support/ruby_features.rb", "lib/rspec/support/spec.rb", "lib/rspec/support/spec/deprecation_helpers.rb", "lib/rspec/support/spec/formatting_support.rb", "lib/rspec/support/spec/in_sub_process.rb", "lib/rspec/support/spec/library_wide_checks.rb", "lib/rspec/support/spec/shell_out.rb", "lib/rspec/support/spec/stderr_splitter.rb", "lib/rspec/support/spec/string_matcher.rb", "lib/rspec/support/spec/with_isolated_directory.rb", "lib/rspec/support/spec/with_isolated_stderr.rb", "lib/rspec/support/version.rb", "lib/rspec/support/version_checker.rb", "lib/rspec/support/warnings.rb"] s.homepage = "https://github.com/rspec/rspec-support" s.licenses = ["MIT"] s.rdoc_options = ["--charset=UTF-8"] s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") - s.rubygems_version = "2.2.2" - s.summary = "rspec-support-3.3.0" + s.rubygems_version = "2.5.1" + s.summary = "rspec-support-3.4.1" if s.respond_to? :specification_version then s.specification_version = 4 @@ -25,12 +25,15 @@ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_development_dependency(%q, ["~> 1.3"]) s.add_development_dependency(%q, ["~> 10.0.0"]) + s.add_development_dependency(%q, ["~> 1.1.0"]) else s.add_dependency(%q, ["~> 1.3"]) s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.1.0"]) end else s.add_dependency(%q, ["~> 1.3"]) s.add_dependency(%q, ["~> 10.0.0"]) + s.add_dependency(%q, ["~> 1.1.0"]) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/debian/rules ruby-rspec-3.4.0c3e0m1s1/debian/rules --- ruby-rspec-3.3.0c2e1m2s0/debian/rules 2015-10-24 13:35:28.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/debian/rules 2016-03-13 19:18:14.000000000 +0000 @@ -7,7 +7,7 @@ # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems -export DH_RUBY_IGNORE_TESTS=ruby2.1 ruby2.2 +export DH_RUBY_IGNORE_TESTS=ruby2.2 ruby2.3 # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec @@ -39,7 +39,7 @@ @dh_testdir @set -e && \ (echo rspec $(RSPEC_VERSION); echo rspec-core $(RSPEC_CORE_VERSION); echo rspec-expectations $(RSPEC_EXPECTATIONS_VERSION); echo rspec-mocks $(RSPEC_MOCKS_VERSION); echo rspec-support $(RSPEC_SUPPORT_VERSION)) | { while read gem version; do \ - new_version=$$(uscan --verbose --report --watch debian/$$gem.watch --upstream-version $$version | sed -n -e 's/^Newest version on remote site is \([^,]*\), .*$$/\1/p'); \ + new_version=$$(uscan --verbose --report --watch debian/$$gem.watch --upstream-version $$version | sed -n -e 's/Newest version .* on remote site is \([^,]*\), .*$$/\1/p'); \ if [ "$$new_major_minor" ]; then \ [ "$$new_major_minor" = "$${new_version%.*}" ] || { echo 'Major/minor version mismatch between gems!' >&2; exit 1; }; \ fi; \ @@ -120,7 +120,9 @@ rm -rf rspec-core/tmp/ rm -rf rspec-expectations/coverage/ rm -rf rspec-mocks/coverage/ + rm -rf rspec-support/coverage/ rm -f rspec-mocks/tmp/file_* + rm -rf rspec-*/spec/support/_* rm -rf man/ dh_auto_clean diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/code_of_conduct.md ruby-rspec-3.4.0c3e0m1s1/rspec/code_of_conduct.md --- ruby-rspec-3.3.0c2e1m2s0/rspec/code_of_conduct.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/code_of_conduct.md 2015-11-12 07:46:41.000000000 +0000 @@ -0,0 +1,37 @@ +# Contributor Code of Conduct + +For the purpose of building a welcoming, harassment-free community that +values contributions from anyone, the RSpec project has adopted the +following code of conduct. All contributors and participants (including +maintainers!) are expected to abide by its terms. + +As contributors and maintainers of this project, we pledge to respect all +people who contribute through reporting issues, posting feature requests, +updating documentation, submitting pull requests or patches, and other +activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion or similar personal characteristic. + +Examples of unacceptable behavior by participants include, but are not limited +to, the use of sexual language or imagery, derogatory comments or personal +attacks, trolling, public or private harassment, insults, or other +unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. Project maintainers who do not +follow the Code of Conduct may be removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by opening an issue or contacting one or more of the project +maintainers. + +This Code of Conduct is adapted from the [Contributor +Covenant](http://contributor-covenant.org), version 1.1.0, available at +[http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/.document ruby-rspec-3.4.0c3e0m1s1/rspec/.document --- ruby-rspec-3.3.0c2e1m2s0/rspec/.document 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/.document 2015-11-12 07:46:41.000000000 +0000 @@ -1,2 +1,2 @@ README.md -License.txt +LICENSE.md diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/.gitignore ruby-rspec-3.4.0c3e0m1s1/rspec/.gitignore --- ruby-rspec-3.3.0c2e1m2s0/rspec/.gitignore 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/.gitignore 2015-11-12 07:46:41.000000000 +0000 @@ -9,3 +9,4 @@ bin bundle .bundle +specs.out diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/lib/rspec/version.rb ruby-rspec-3.4.0c3e0m1s1/rspec/lib/rspec/version.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec/lib/rspec/version.rb 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/lib/rspec/version.rb 2015-11-12 07:46:41.000000000 +0000 @@ -1,5 +1,5 @@ module RSpec # :nodoc: module Version # :nodoc: - STRING = '3.3.0' + STRING = '3.4.0' end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/LICENSE.md ruby-rspec-3.4.0c3e0m1s1/rspec/LICENSE.md --- ruby-rspec-3.3.0c2e1m2s0/rspec/LICENSE.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/LICENSE.md 2015-11-12 07:46:41.000000000 +0000 @@ -0,0 +1,27 @@ +The MIT License (MIT) +===================== + +Copyright © 2009 Chad Humphries, David Chelimsky +Copyright © 2006 David Chelimsky, The RSpec Development Team +Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the “Software”), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/License.txt ruby-rspec-3.4.0c3e0m1s1/rspec/License.txt --- ruby-rspec-3.3.0c2e1m2s0/rspec/License.txt 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/License.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2009 Chad Humphries, David Chelimsky -Copyright (c) 2006 David Chelimsky, The RSpec Development Team -Copyright (c) 2005 Steven Baker - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/README.md ruby-rspec-3.4.0c3e0m1s1/rspec/README.md --- ruby-rspec-3.3.0c2e1m2s0/rspec/README.md 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/README.md 2015-11-12 07:46:41.000000000 +0000 @@ -4,16 +4,20 @@ # Description -rspec is a meta-gem, which depends on the [rspec-core](https://github.com/rspec/rspec-core), [rspec-expectations](https://github.com/rspec/rspec-expectations) -and [rspec-mocks](https://github.com/rspec/rspec-mocks) gems. Each of these can be installed separately and loaded in -isolation using `require`. Among other benefits, this allows you to use -rspec-expectations, for example, in Test::Unit::TestCase if you happen to -prefer that style. +rspec is a meta-gem, which depends on the +[rspec-core](https://github.com/rspec/rspec-core), +[rspec-expectations](https://github.com/rspec/rspec-expectations) +and [rspec-mocks](https://github.com/rspec/rspec-mocks) gems. Each of these +can be installed separately and loaded in isolation using `require`. Among +other benefits, this allows you to use rspec-expectations, for example, in +Test::Unit::TestCase if you happen to prefer that style. Conversely, if you like RSpec's approach to declaring example groups and -examples (`describe` and `it`) but prefer Test::Unit assertions and mocha, rr -or flexmock for mocking, you'll be able to do that without having to install or load the -components of RSpec that you're not using. +examples (`describe` and `it`) but prefer Test::Unit assertions and +[mocha](https://github.com/mochajs/mocha), [rr] (https://github.com/btakita/rr) +or [flexmock] (https://github.com/jimweirich/flexmock) for mocking, you'll be +able to do that without having to install or load the components of RSpec that +you're not using. ## Documentation @@ -29,6 +33,7 @@ ## Also see -* -* -* +* [https://github.com/rspec/rspec-core](https://github.com/rspec/rspec-core) +* [https://github.com/rspec/rspec-expectations](https://github.com/rspec/rspec-expectations) +* [https://github.com/rspec/rspec-mocks](https://github.com/rspec/rspec-mocks) +* [https://github.com/rspec/rspec-rails](https://github.com/rspec/rspec-rails) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec/rspec.gemspec ruby-rspec-3.4.0c3e0m1s1/rspec/rspec.gemspec --- ruby-rspec-3.3.0c2e1m2s0/rspec/rspec.gemspec 2015-06-12 15:04:05.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec/rspec.gemspec 2015-11-12 07:46:41.000000000 +0000 @@ -15,7 +15,7 @@ s.description = "BDD for Ruby" s.files = `git ls-files -- lib/*`.split("\n") - s.files += ["License.txt"] + s.files += ["LICENSE.md"] s.test_files = `git ls-files -- {spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.extra_rdoc_files = [ "README.md" ] diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/appveyor.yml ruby-rspec-3.4.0c3e0m1s1/rspec-core/appveyor.yml --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/appveyor.yml 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/appveyor.yml 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. version: "{build}" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/BUILD_DETAIL.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/BUILD_DETAIL.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/BUILD_DETAIL.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/BUILD_DETAIL.md 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,149 @@ + + +# The CI build, in detail + +The [Travis CI build](https://travis-ci.org/rspec/rspec-core) +runs many verification steps to prevent regressions and +ensure high-quality code. To run the Travis build locally, run: + +``` +$ script/run_build +``` + +It can be useful to run the build steps individually +to repro a failing part of a Travis build. Let's break +the build down into the individual steps. + +## Specs + +RSpec dogfoods itself. Its primary defense against regressions is its spec suite. Run with: + +``` +$ bundle exec rspec + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/rspec +``` + +The spec suite performs a couple extra checks that are worth noting: + +* *That all the code is warning-free.* Any individual example that produces output + to `stderr` will fail. We also have a spec that loads all the `lib` and `spec` + files in a newly spawned process to detect load-time warnings and fail if there + are any. RSpec must be warning-free so that users who enable Ruby warnings will + not get warnings from our code. +* *That only a minimal set of stdlibs are loaded.* Since Ruby makes loaded libraries + available for use in any context, we want to minimize how many bits of the standard + library we load and use. Otherwise, RSpec's use of part of the standard library could + mask a problem where a gem author forgets to load a part of the standard library they + rely on. The spec suite contains a spec that defines a whitelist of allowed loaded + stdlibs. + +In addition, we use [SimpleCov](https://github.com/colszowka/simplecov) +to measure and enforce test coverage. If the coverage falls below a +project-specific threshold, the build will fail. + +## Cukes + +RSpec uses [cucumber](https://cucumber.io/) for both acceptance testing +and [documentation](https://relishapp.com/rspec). Since we publish our cukes +as documentation, please limit new cucumber scenarios to user-facing examples +that help demonstrate usage. Any tests that exist purely to prevent regressions +should be written as specs, even if they are written in an acceptance style. +Duplication between our YARD API docs and the cucumber documentation is fine. + +Run with: + +``` +$ bundle exec cucumber + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/cucumber +``` + +## YARD documentation + +RSpec uses [YARD](http://yardoc.org/) for API documentation on the [rspec.info site](http://rspec.info/). +Our commitment to [SemVer](htp://semver.org) requires that we explicitly +declare our public API, and our build uses YARD to ensure that every +class, module and method has either been labeled `@private` or has at +least some level of documentation. For new APIs, this forces us to make +an intentional decision about whether or not it should be part of +RSpec's public API or not. + +To run the YARD documentation coverage check, run: + +``` +$ bundle exec yard stats --list-undoc + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/yard stats --list-undoc +``` + +We also want to prevent YARD errors or warnings when actually generating +the docs. To check for those, run: + +``` +$ bundle exec yard doc --no-cache + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/yard doc --no-cache +``` + +## Rubocop + +We use [Rubocop](https://github.com/bbatsov/rubocop) to enforce style conventions on the project so +that the code has stylistic consistency throughout. Run with: + +``` +$ bundle exec rubocop lib + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/rubocop lib +``` + +Our Rubocop configuration is a work-in-progress, so if you get a failure +due to a Rubocop default, feel free to ask about changing the +configuration. Otherwise, you'll need to address the Rubocop failure, +or, as a measure of last resort, by wrapping the offending code in +comments like `# rubocop:disable SomeCheck` and `# rubocop:enable SomeCheck`. + +## Run spec files one-by-one + +A fast TDD cycle depends upon being able to run a single spec file, +without the rest of the test suite. While rare, it's fairly easy to +create a situation where a spec passes when the entire suite runs +but fails when its individual file is run. To guard against this, +our CI build runs each spec file individually, using a bit of bash like: + +``` +for file in `find spec -iname '*_spec.rb'`; do + echo "Running $file" + bin/rspec $file -b --format progress +done +``` + +Since this step boots RSpec so many times, it runs much, much +faster when we can avoid the overhead of bundler. This is a main reason our +CI build installs the bundle with `--standalone --binstubs` and +runs RSpec via `bin/rspec` rather than `bundle exec rspec`. + +## Running the spec suite for each of the other repos + +While each of the RSpec repos is an independent gem (generally designed +to be usable on its own), there are interdependencies between the gems, +and the specs for each tend to use features from the other gems. We +don't want to merge a pull request for one repo that might break the +build for another repo, so our CI build includes a spec that runs the +spec suite of each of the _other_ project repos. Note that we only run +the spec suite, not the full build, of the other projects, as the spec +suite runs very quickly compared to the full build. + diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/Changelog.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/Changelog.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/Changelog.md 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/Changelog.md 2016-02-18 22:33:38.000000000 +0000 @@ -1,3 +1,111 @@ +### Development +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.4.3...3-4-maintenance) + +### 3.4.3 / 2016-02-19 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.4.2...3.4.3) + +Bug Fixes: + +* Prevent a `TypeError` from occuring when running via the rake task when + Ruby crashes. (Patrik Wenger, #2161) +* Only consider example and group declaration lines from a specific file + when applying line number filtering, instead of considering all + declaration lines from all spec files. (Myron Marston, #2170) +* Fix failure snippet extraction so that snippets that contain `do-end` style + block and end with `end`-only line can be extracted properly. + (Yuji Nakayama, #2173) + +### 3.4.2 / 2016-01-26 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.4.1...v3.4.2) + +Bug Fixes: + +* Fix `rspec --profile` when an example calls `abort` or `exit`. + (Bradley Schaefer, #2144) +* Fix `--drb` so that when no DRb server is running, it prevents + the DRb connection error from being listed as the cause of all + expectation failures. (Myron Marston, #2156) +* Fix syntax highlighter so that it works when the `coderay` gem is + installed as a rubygem but not already available on your load path + (as happens when you use bundler). (Myron Marston, #2159) + +### 3.4.1 / 2015-11-18 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.4.0...v3.4.1) + +Bug Fixes: + +* Fix backtrace formatter to handle backtraces that are `nil`. + (Myron Marston, #2118) + +### 3.4.0 / 2015-11-11 +[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.3.2...v3.4.0) + +Enhancements: + +* Combine multiple `--pattern` arguments making them equivalent to + `--pattern=1,2,...,n`. (Jon Rowe, #2002) +* Improve `inspect` and `to_s` output for `RSpec::Core::Example` + objects, replacing Ruby's excessively verbose output. (Gavin Miller, #1922) +* Add `silence_filter_announcements` configuration option. + (David Raffensperger, #2007) +* Add optional `example_finished` notification to the reporter protocol for + when you don't care about the example outcome. (Jon Rowe, #2013) +* Switch `--bisect` to a recursion-based bisection algorithm rather than + a permutation-based one. This better handles cases where an example + depends upon multiple other examples instead of just one and minimizes + the number of runs necessary to determine that an example set cannot be + minimized further. (Simon Coffey, #1997) +* Allow simple filters (e.g. `:symbol` key only) to be triggered by truthey + values. (Tim Mertens, #2035) +* Remove unneeded warning about need for `ansicon` on Windows when using + RSpec's `--color` option. (Ashley Engelund, #2038) +* Add option to configure RSpec to raise errors when issuing warnings. + (Jon Rowe, #2052) +* Append the root `cause` of a failure or error to the printed failure + output when a `cause` is available. (Adam Magan) +* Stop rescuing `NoMemoryError`, `SignalExcepetion`, `Interrupt` and + `SystemExit`. It is dangerous to interfere with these. (Myron Marston, #2063) +* Add `config.project_source_dirs` setting which RSpec uses to determine + if a backtrace line comes from your project source or from some + external library. It defaults to `spec`, `lib` and `app` but can be + configured differently. (Myron Marston, #2088) +* Improve failure line detection so that it looks for the failure line + in any project source directory instead of just in the spec file. + In addition, if no backtrace lines can be found from a project source + file, we fall back to displaying the source of the first backtrace + line. This should virtually eliminate the "Unable to find matching + line from backtrace" messages. (Myron Marston, #2088) +* Add support for `:extra_failure_lines` example metadata that will + be appended to the failure output. (bootstraponline, #2092). +* Add `RSpec::Core::Example#duplicate_with` to produce new examples + with cloned metadata. (bootstraponline, #2098) +* Add `RSpec::Core::Configuration#on_example_group_definition` to register + hooks to be invoked when example groups are created. (bootstraponline, #2094) +* Add `add_example` and `remove_example` to `RSpec::Core::ExampleGroup` to + allow manipulating an example groups examples. (bootstraponline, #2095) +* Display multiline failure source lines in failure output when Ripper is + available (MRI >= 1.9.2, and JRuby >= 1.7.5 && < 9.0.0.0.rc1). + (Yuji Nakayama, #2083) +* Add `max_displayed_failure_line_count` configuration option + (defaults to 10). (Yuji Nakayama, #2083) +* Enhance `fail_fast` option so it can take a number (e.g. `--fail-fast=3`) + to force the run to abort after the specified number of failures. + (Jack Scotti, #2065) +* Syntax highlight the failure snippets in text formatters when `color` + is enabled and the `coderay` gem is installed on a POSIX system. + (Myron Marston, #2109) + +Bug Fixes: + +* Lock `example_status_persistence_file` when reading from and writing + to it to prevent race conditions when multiple processes try to use + it. (Ben Woosley, #2029) +* Fix regression in 3.3 that caused spec file names with square brackets in + them (such as `1[]_spec.rb`) to not be loaded properly. (Myron Marston, #2041) +* Fix output encoding issue caused by ASCII literal on 1.9.3 (Jon Rowe, #2072) +* Fix requires in `rspec/core/rake_task.rb` to avoid double requires + seen by some users. (Myron Marston, #2101) + ### 3.3.2 / 2015-07-15 [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.3.1...v3.3.2) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/CODE_OF_CONDUCT.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/CODE_OF_CONDUCT.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/CODE_OF_CONDUCT.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/CODE_OF_CONDUCT.md 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,42 @@ + + +# Contributor Code of Conduct + +For the purpose of building a welcoming, harassment-free community that +values contributions from anyone, the RSpec project has adopted the +following code of conduct. All contributors and participants (including +maintainers!) are expected to abide by its terms. + +As contributors and maintainers of this project, we pledge to respect all +people who contribute through reporting issues, posting feature requests, +updating documentation, submitting pull requests or patches, and other +activities. + +We are committed to making participation in this project a harassment-free +experience for everyone, regardless of level of experience, gender, gender +identity and expression, sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion or similar personal characteristic. + +Examples of unacceptable behavior by participants include, but are not limited +to, the use of sexual language or imagery, derogatory comments or personal +attacks, trolling, public or private harassment, insults, or other +unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. Project maintainers who do not +follow the Code of Conduct may be removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by opening an issue or contacting one or more of the project +maintainers. + +This Code of Conduct is adapted from the [Contributor +Covenant](http://contributor-covenant.org), version 1.1.0, available at +[http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/CONTRIBUTING.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/CONTRIBUTING.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/CONTRIBUTING.md 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,25 @@ + + +# Contributing + +RSpec is a community-driven project that has benefited from improvements from over over *500* contributors. +We welcome contributions from *everyone*. While contributing, please follow the project [code of conduct](CODE_OF_CONDUCT.md), so that everyone can be included. + +If you'd like to help make RSpec better, here are some ways you can contribute: + + - by running RSpec HEAD to help us catch bugs before new releases + - by [reporting bugs you encounter](https://github.com/rspec/rspec-core/issues/new) + - by [suggesting new features](https://github.com/rspec/rspec-core/issues/new) + - by improving RSpec's [Relish](https://relishapp.com/rspec) or [API](http://rspec.info/documentation/) documentation + - by improving [RSpec's website](http://rspec.info/) ([source](https://github.com/rspec/rspec.github.io)) + - by taking part in [feature and issue discussions](https://github.com/rspec/rspec-core/issues) + - by adding a failing test for reproducible [reported bugs](https://github.com/rspec/rspec-core/issues) + - by reviewing [pull requests](https://github.com/rspec/rspec-core/pulls) and suggesting improvements + - by [writing code](DEVELOPMENT.md) (no patch is too small! fix typos or bad whitespace) + +If you need help getting started, check out the [DEVELOPMENT](DEVELOPMENT.md) file for steps that will get you up and running. + +Thanks for helping us make RSpec better! diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/DEVELOPMENT.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/DEVELOPMENT.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/DEVELOPMENT.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/DEVELOPMENT.md 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,132 @@ + + +# Development Setup + +Generally speaking, you only need to clone the project and install +the dependencies with [Bundler](http://bundler.io/). You can either +get a full RSpec development environment using +[rspec-dev](https://github.com/rspec/rspec-dev#README) or you can +set this project up individually. + +## Setting up rspec-core individually + +For most contributors, setting up the project individually will be simpler. +Unless you have a specific reason to use rspec-dev, we recommend using this approach. + +Clone the repo: + +``` +$ git clone git@github.com:rspec/rspec-core.git +``` + +Install the dependencies using [Bundler](http://bundler.io/): + +``` +$ cd rspec-core +$ bundle install +``` + +To minimize boot time and to ensure we don't depend upon any extra dependencies +loaded by Bundler, our CI builds avoid loading Bundler at runtime +by using Bundler's [`--standalone option`](http://myronmars.to/n/dev-blog/2012/03/faster-test-boot-times-with-bundler-standalone). +While not strictly necessary (many/most of our contributors do not do this!), +if you want to exactly reproduce our CI builds you'll want to do the same: + +``` +$ bundle install --standalone --binstubs +``` + +The `--binstubs` option creates the `bin/rspec` file that, like `bundle exec rspec`, will load +all the versions specified in `Gemfile.lock` without loading bundler at runtime! + +## Using rspec-dev + +See the [rspec-dev README](https://github.com/rspec/rspec-dev#README) +for setup instructions. + +The rspec-dev project contains many rake tasks for helping manage +an RSpec development environment, making it easy to do things like: + +* Change branches across all repos +* Update all repos with the latest code from `master` +* Cut a new release across all repos +* Push out updated build scripts to all repos + +These sorts of tasks are essential for the RSpec maintainers but will +probably be unnecessary complexity if you're just contributing to one +repository. If you are getting setup to make your first contribution, +we recommend you take the simpler route of setting up rspec-core +individually. + +## Gotcha: Version mismatch from sibling repos + +The [Gemfile](Gemfile) is designed to be flexible and support using +the other RSpec repositories either from a local sibling directory +(e.g. `../rspec-`) or, if there is no such directory, +directly from git. This generally does the "right thing", but can +be a gotcha in some situations. For example, if you are setting up +`rspec-core`, and you happen to have an old clone of `rspec-expectations` +in a sibling directory, it'll be used even though it might be months or +years out of date, which can cause confusing failures. + +To avoid this problem, you can either `export USE_GIT_REPOS=1` to force +the use of `:git` dependencies instead of local dependencies, or update +the code in the sibling directory. rspec-dev contains rake tasks to +help you keep all repos in sync. + +## Extra Gems + +If you need additional gems for any tasks---such as `benchmark-ips` for benchmarking +or `byebug` for debugging---you can create a `Gemfile-custom` file containing those +gem declarations. The `Gemfile` evaluates that file if it exists, and it is git-ignored. + +# Running the build + +The [Travis CI build](https://travis-ci.org/rspec/rspec-core) +runs many verification steps to prevent regressions and +ensure high-quality code. To run the Travis build locally, run: + +``` +$ script/run_build +``` + +See [build detail](BUILD_DETAIL.md) for more detail. + +# What to Expect + +To ensure high, uniform code quality, all code changes (including +changes from the maintainers!) are subject to a pull request code +review. We'll often ask for clarification or suggest alternate ways +to do things. Our code reviews are intended to be a two-way +conversation. + +Here's a short, non-exhaustive checklist of things we typically ask contributors to do before PRs are ready to merge. It can help get your PR merged faster if you do these in advance! + +- [ ] New behavior is covered by tests and all tests are passing. +- [ ] No Ruby warnings are issued by your changes. +- [ ] Documentation reflects changes and renders as intended. +- [ ] Rubocop passes (e.g. `bundle exec rubocop lib`). +- [ ] Commits are squashed into a reasonable number of logical changesets that tell an easy-to-follow story. +- [ ] No changelog entry is necessary (we'll add it as part of the merge process!) + +# Adding Docs + +RSpec uses [YARD](http://yardoc.org/) for its API documentation. To +ensure the docs render well, we recommend running a YARD server and +viewing your edits in a browser. + +To run a YARD server: + +``` +$ bundle exec yard server --reload + +# or, if you installed your bundle with `--standalone --binstubs`: + +$ bin/yard server --reload +``` + +Then navigate to `localhost:8808` to view the rendered docs. + diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/.document ruby-rspec-3.4.0c3e0m1s1/rspec-core/.document --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/.document 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/.document 2016-02-18 22:33:38.000000000 +0000 @@ -1,5 +1,5 @@ lib/**/*.rb - README.md -License.txt +LICENSE.md Changelog.md diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/bisect.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/bisect.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/bisect.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/bisect.feature 2016-02-18 22:33:38.000000000 +0000 @@ -54,12 +54,12 @@ Bisect started using options: "--seed 1234" Running suite to find failures... (0.16755 seconds) Starting bisect with 1 failing example and 9 non-failing examples. + Checking that failure(s) are order-dependent... failure appears to be order-dependent - Round 1: searching for 5 non-failing examples (of 9) to ignore: .. (0.30166 seconds) - Round 2: searching for 3 non-failing examples (of 5) to ignore: .. (0.30306 seconds) - Round 3: searching for 2 non-failing examples (of 3) to ignore: .. (0.33292 seconds) - Round 4: searching for 1 non-failing example (of 2) to ignore: . (0.16476 seconds) - Round 5: searching for 1 non-failing example (of 1) to ignore: . (0.15329 seconds) + Round 1: bisecting over non-failing examples 1-9 .. ignoring examples 6-9 (0.30166 seconds) + Round 2: bisecting over non-failing examples 1-5 .. ignoring examples 4-5 (0.30306 seconds) + Round 3: bisecting over non-failing examples 1-3 .. ignoring example 3 (0.33292 seconds) + Round 4: bisecting over non-failing examples 1-2 . ignoring example 1 (0.16476 seconds) Bisect complete! Reduced necessary non-failing examples from 9 to 1 in 1.26 seconds. The minimal reproduction command is: @@ -75,10 +75,11 @@ Bisect started using options: "--seed 1234" Running suite to find failures... (0.17102 seconds) Starting bisect with 1 failing example and 9 non-failing examples. + Checking that failure(s) are order-dependent... failure appears to be order-dependent - Round 1: searching for 5 non-failing examples (of 9) to ignore: .. (0.32943 seconds) - Round 2: searching for 3 non-failing examples (of 5) to ignore: .. (0.3154 seconds) - Round 3: searching for 2 non-failing examples (of 3) to ignore: .. + Round 1: bisecting over non-failing examples 1-9 .. ignoring examples 6-9 (0.32943 seconds) + Round 2: bisecting over non-failing examples 1-5 .. ignoring examples 4-5 (0.3154 seconds) + Round 3: bisecting over non-failing examples 1-3 .. ignoring example 3 (0.2175 seconds) Bisect aborted! @@ -106,8 +107,10 @@ - ./spec/calculator_7_spec.rb[1:1] - ./spec/calculator_8_spec.rb[1:1] - ./spec/calculator_9_spec.rb[1:1] - - Round 1: searching for 5 non-failing examples (of 9) to ignore: + Checking that failure(s) are order-dependent.. + - Running: rspec ./spec/calculator_1_spec.rb[1:1] --seed 1234 (n.nnnn seconds) + - Failure appears to be order-dependent + Round 1: bisecting over non-failing examples 1-9 - Running: rspec ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_6_spec.rb[1:1] ./spec/calculator_7_spec.rb[1:1] ./spec/calculator_8_spec.rb[1:1] ./spec/calculator_9_spec.rb[1:1] --seed 1234 (0.15302 seconds) - Running: rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_2_spec.rb[1:1] ./spec/calculator_3_spec.rb[1:1] ./spec/calculator_4_spec.rb[1:1] ./spec/calculator_5_spec.rb[1:1] --seed 1234 (0.19708 seconds) - Examples we can safely ignore (4): @@ -121,8 +124,7 @@ - ./spec/calculator_3_spec.rb[1:1] - ./spec/calculator_4_spec.rb[1:1] - ./spec/calculator_5_spec.rb[1:1] - - Round finished (0.35172 seconds) - Round 2: searching for 3 non-failing examples (of 5) to ignore: + Round 2: bisecting over non-failing examples 1-5 - Running: rspec ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_4_spec.rb[1:1] ./spec/calculator_5_spec.rb[1:1] --seed 1234 (0.15836 seconds) - Running: rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_2_spec.rb[1:1] ./spec/calculator_3_spec.rb[1:1] --seed 1234 (0.19065 seconds) - Examples we can safely ignore (2): @@ -132,8 +134,7 @@ - ./spec/calculator_10_spec.rb[1:1] - ./spec/calculator_2_spec.rb[1:1] - ./spec/calculator_3_spec.rb[1:1] - - Round finished (0.35022 seconds) - Round 3: searching for 2 non-failing examples (of 3) to ignore: + Round 3: bisecting over non-failing examples 1-3 - Running: rspec ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_2_spec.rb[1:1] --seed 1234 (0.21028 seconds) - Running: rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] ./spec/calculator_3_spec.rb[1:1] --seed 1234 (0.1975 seconds) - Examples we can safely ignore (1): @@ -141,17 +142,12 @@ - Remaining non-failing examples (2): - ./spec/calculator_10_spec.rb[1:1] - ./spec/calculator_3_spec.rb[1:1] - - Round finished (0.40882 seconds) - Round 4: searching for 1 non-failing example (of 2) to ignore: + Round 4: bisecting over non-failing examples 1-2 - Running: rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] --seed 1234 (0.17173 seconds) - Examples we can safely ignore (1): - ./spec/calculator_3_spec.rb[1:1] - Remaining non-failing examples (1): - ./spec/calculator_10_spec.rb[1:1] - - Round finished (0.17234 seconds) - Round 5: searching for 1 non-failing example (of 1) to ignore: - - Running: rspec ./spec/calculator_1_spec.rb[1:1] --seed 1234 (0.18279 seconds) - - Round finished (0.18312 seconds) Bisect complete! Reduced necessary non-failing examples from 9 to 1 in 1.47 seconds. The minimal reproduction command is: diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/fail_fast.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/fail_fast.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/fail_fast.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/fail_fast.feature 2016-02-18 22:33:38.000000000 +0000 @@ -3,17 +3,29 @@ Use the `--fail-fast` option to tell RSpec to stop running the test suite on the first failed test. - You may also specify `--no-fail-fast` to turn it off (default behaviour). + You may add a parameter to tell RSpec to stop running the test suite after N + failed tests, for example: `--fail-fast=3`. + + You can also specify `--no-fail-fast` to turn it off (default behaviour). Background: Given a file named "fail_fast_spec.rb" with: """ruby RSpec.describe "fail fast" do it "passing test" do; end - it "failing test" do + it "1st failing test" do + fail + end + it "2nd failing test" do + fail + end + it "3rd failing test" do fail end - it "this should not be run" do; end + it "4th failing test" do + fail + end + it "passing test" do; end end """ @@ -22,6 +34,11 @@ Then the output should contain ".F" Then the output should not contain ".F." + Scenario: Using `--fail-fast=3` + When I run `rspec . --fail-fast=3` + Then the output should contain ".FFF" + Then the output should not contain ".FFFF." + Scenario: Using `--no-fail-fast` When I run `rspec . --no-fail-fast` - Then the output should contain ".F." + Then the output should contain ".FFFF." diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/tag.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/tag.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/command_line/tag.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/command_line/tag.feature 2016-02-18 22:33:38.000000000 +0000 @@ -1,20 +1,21 @@ Feature: `--tag` option - Use the `--tag` (or `-t`) option to filter the examples by tags. + Use the `--tag` (or `-t`) option to run examples that match a specified tag. + The tag can be a simple `name` or a `name:value` pair. - The tag can be a simple `name` or a `name:value` pair. In the first case, - examples with `:name => true` will be filtered. In the second case, examples - with `:name => value` will be filtered, where `value` is always a string. In - both cases, `name` is converted to a symbol. - - Filters are represented internally as a hash, which means that you can't - specify multiple filters for the same key. If you try to exclude `:name => 'foo'` - and `:name => 'bar'`, you will only end up excluding `:name => 'bar'`. + If a simple `name` is supplied, only examples with `:name => true` will run. + If a `name:value` pair is given, examples with `name => value` will run, + where `value` is always a string. In both cases, `name` is converted to a symbol. Tags can also be used to exclude examples by adding a `~` before the tag. For - example `~tag` will exclude all examples marked with `:tag => true` and + example, `~tag` will exclude all examples marked with `:tag => true` and `~tag:value` will exclude all examples marked with `:tag => value`. + Filtering by tag uses a hash internally, which means that you can't specify + multiple filters for the same key. For instance, if you try to exclude + `:name => 'foo'` and `:name => 'bar'`, you will only end up excluding + `:name => 'bar'`. + To be compatible with the Cucumber syntax, tags can optionally start with an `@` symbol, which will be ignored. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/configuration/color.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/configuration/color.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/configuration/color.feature 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/configuration/color.feature 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,22 @@ +Feature: Windows may require additional solutions to display color + + The output uses [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) to show text in color. Windows + systems (shells) often don't interpret those codes at all. + + If you're on Windows and you see ANSI escape codes in the output + (something like `[1m [31m` ) and your text isn't in different colors, + you may need to install a utility so that your Windows shell will + interpret those codes correctly and show the colors. Here are some + popular solutions: + + * [ANSICON](https://github.com/adoxa/ansicon): ANSICON runs 'on top of' cmd or powershell. This is a very + popular solution. You can set it up so that it's always used whenever + you use cmd or powershell, or use it only at specific times. + + * Alternatives to cmd.exe or powershell: [ConEmu](http://conemu.github.io/), [Console2](http://sourceforge.net/projects/console/), + [ConsoleZ](https://github.com/cbucher/console) + + * Unix-like shells and utilities: [cygwin](https://www.cygwin.com/), [babun](http://babun.github.io/index.html), + [MinGW](http://www.mingw.org/) (Minimalist GNU for Windows) + + To find out more, search for information about those solutions. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/configuration/fail_fast.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/configuration/fail_fast.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/configuration/fail_fast.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/configuration/fail_fast.feature 2016-02-18 22:33:38.000000000 +0000 @@ -1,19 +1,13 @@ Feature: fail fast - Use the `fail_fast` option to tell RSpec to abort the run on first failure: + Use the `fail_fast` option to tell RSpec to abort the run after N failures: - ```ruby - RSpec.configure { |c| c.fail_fast = true } - ``` - - Background: + Scenario: `fail_fast` with no failures (runs all examples) Given a file named "spec/spec_helper.rb" with: """ruby - RSpec.configure {|c| c.fail_fast = true} + RSpec.configure {|c| c.fail_fast = 1} """ - - Scenario: `fail_fast` with no failures (runs all examples) - Given a file named "spec/example_spec.rb" with: + And a file named "spec/example_spec.rb" with: """ruby RSpec.describe "something" do it "passes" do @@ -27,7 +21,11 @@ Then the examples should all pass Scenario: `fail_fast` with first example failing (only runs the one example) - Given a file named "spec/example_spec.rb" with: + Given a file named "spec/spec_helper.rb" with: + """ruby + RSpec.configure {|c| c.fail_fast = 1} + """ + And a file named "spec/example_spec.rb" with: """ruby require "spec_helper" RSpec.describe "something" do @@ -43,7 +41,11 @@ Then the output should contain "1 example, 1 failure" Scenario: `fail_fast` with multiple files, second example failing (only runs the first two examples) - Given a file named "spec/example_1_spec.rb" with: + Given a file named "spec/spec_helper.rb" with: + """ruby + RSpec.configure {|c| c.fail_fast = 1} + """ + And a file named "spec/example_1_spec.rb" with: """ruby require "spec_helper" RSpec.describe "something" do @@ -77,3 +79,31 @@ """ When I run `rspec spec` Then the output should contain "2 examples, 1 failure" + + + Scenario: `fail_fast 2` with 1st and 3rd examples failing (only runs the first 3 examples) + Given a file named "spec/spec_helper.rb" with: + """ruby + RSpec.configure {|c| c.fail_fast = 2} + """ + And a file named "spec/example_spec.rb" with: + """ruby + require "spec_helper" + RSpec.describe "something" do + it "fails once" do + fail + end + + it "passes once" do + end + + it "fails twice" do + fail + end + + it "passes" do + end + end + """ + When I run `rspec spec/example_spec.rb -fd` + Then the output should contain "3 examples, 2 failures" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/example_groups/shared_examples.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/example_groups/shared_examples.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/example_groups/shared_examples.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/example_groups/shared_examples.feature 2016-02-18 22:33:38.000000000 +0000 @@ -34,8 +34,8 @@ end RSpec.describe SomeClass do - include_example "some example", "parameter1" - include_example "some example", "parameter2" + include_examples "some example", "parameter1" + include_examples "some example", "parameter2" end ``` @@ -60,7 +60,7 @@ To prevent this kind of subtle error a warning is emitted if you declare multiple methods with the same name in the same context. Should you get this warning - the simplest solution is to replace `include_example` with `it_behaves_like`, in this + the simplest solution is to replace `include_examples` with `it_behaves_like`, in this way method overriding is avoided because of the nested context created by `it_behaves_like` Conventions: diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/expectation_framework_integration/aggregating_failures.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/expectation_framework_integration/aggregating_failures.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/expectation_framework_integration/aggregating_failures.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/expectation_framework_integration/aggregating_failures.feature 2016-02-18 22:33:38.000000000 +0000 @@ -1,6 +1,6 @@ Feature: Aggregating Failures - RSpec::Expectations provides [`aggregate_failures`](/rspec/rspec-expectations/v/3-3/docs/aggregating-failures), an API that allows you to group a set of expectations and see all the failures at once, rather than it aborting on the first failure. RSpec::Core improves on this feature in a couple of ways: + RSpec::Expectations provides [`aggregate_failures`](/rspec/rspec-expectations/v/3-4/docs/aggregating-failures), an API that allows you to group a set of expectations and see all the failures at once, rather than it aborting on the first failure. RSpec::Core improves on this feature in a couple of ways: * RSpec::Core provides much better failure output, adding code snippets and backtraces to the sub-failures, just like it does for any normal failure. * RSpec::Core provides [metadata](../metadata/user-defined-metadata) integration for this feature. Each example that is tagged with `:aggregate_failures` will be wrapped in an `aggregate_failures` block. You can also use `config.define_derived_metadata` to apply this to every example automatically. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/hooks/filtering.feature ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/hooks/filtering.feature --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/hooks/filtering.feature 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/hooks/filtering.feature 2016-02-18 22:33:38.000000000 +0000 @@ -244,3 +244,186 @@ .after context """ + Scenario: Filtering hooks using symbols + Given a file named "filter_example_hooks_with_symbol_spec.rb" with: + """ruby + RSpec.configure do |config| + config.before(:example, :foo) do + invoked_hooks << :before_example_foo_bar + end + end + + RSpec.describe "a filtered before :example hook" do + let(:invoked_hooks) { [] } + + describe "group without a matching metadata key" do + it "does not run the hook" do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook for an example with metadata hash containing the key with a falsey value", :foo => nil do + expect(invoked_hooks).to be_empty + end + + it "runs the hook for an example with metadata hash containing the key with a truthy value", :foo => :bar do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + + it "runs the hook for an example with only the key defined", :foo do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + + describe "group with matching metadata key", :foo do + it "runs the hook" do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + end + """ + When I run `rspec filter_example_hooks_with_symbol_spec.rb` + Then the examples should all pass + + Scenario: Filtering hooks using a hash + Given a file named "filter_example_hooks_with_hash_spec.rb" with: + """ruby + RSpec.configure do |config| + config.before(:example, :foo => { :bar => :baz, :slow => true }) do + invoked_hooks << :before_example_foo_bar + end + end + + RSpec.describe "a filtered before :example hook" do + let(:invoked_hooks) { [] } + + describe "group without matching metadata" do + it "does not run the hook" do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook for an example if only part of the filter matches", :foo => { :bar => :baz } do + expect(invoked_hooks).to be_empty + end + + it "runs the hook for an example if the metadata contains all key value pairs from the filter", :foo => { :bar => :baz, :slow => true, :extra => :pair } do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + + describe "group with matching metadata", :foo => { :bar => :baz, :slow => true } do + it "runs the hook" do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + end + """ + When I run `rspec filter_example_hooks_with_hash_spec.rb` + Then the examples should all pass + + Scenario: Filtering hooks using a Proc + Given a file named "filter_example_hooks_with_proc_spec.rb" with: + """ruby + RSpec.configure do |config| + config.before(:example, :foo => Proc.new { |value| value.is_a?(String) } ) do + invoked_hooks << :before_example_foo_bar + end + end + + RSpec.describe "a filtered before :example hook" do + let(:invoked_hooks) { [] } + + describe "group without matching metadata" do + it "does not run the hook" do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook if the proc returns false", :foo => :bar do + expect(invoked_hooks).to be_empty + end + + it "runs the hook if the proc returns true", :foo => 'bar' do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + + describe "group with matching metadata", :foo => 'bar' do + it "runs the hook" do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + end + """ + When I run `rspec filter_example_hooks_with_proc_spec.rb` + Then the examples should all pass + + Scenario: Filtering hooks using a regular expression + Given a file named "filter_example_hooks_with_regexp_spec.rb" with: + """ruby + RSpec.configure do |config| + config.before(:example, :foo => /bar/ ) do + invoked_hooks << :before_example_foo_bar + end + end + + RSpec.describe "a filtered before :example hook" do + let(:invoked_hooks) { [] } + + describe "group without matching metadata" do + it "does not run the hook" do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook if the value does not match", :foo => 'baz' do + expect(invoked_hooks).to be_empty + end + + it "runs the hook if the value matches", :foo => 'bar' do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + + describe "group with matching metadata", :foo => 'bar' do + it "runs the hook" do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + end + """ + When I run `rspec filter_example_hooks_with_regexp_spec.rb` + Then the examples should all pass + + Scenario: Filtering hooks using string comparison + Given a file named "filter_example_hooks_with_strcmp_spec.rb" with: + """ruby + RSpec.configure do |config| + config.before(:example, :foo => :bar ) do + invoked_hooks << :before_example_foo_bar + end + end + + RSpec.describe "a filtered before :example hook" do + let(:invoked_hooks) { [] } + + describe "group without matching metadata" do + it "does not run the hook" do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook if the coerced values do not match", :foo => 'baz' do + expect(invoked_hooks).to be_empty + end + + it "does not run the hook if the coerced values match", :foo => 'bar' do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + + describe "group with matching metadata", :foo => 'bar' do + it "runs the hook" do + expect(invoked_hooks).to eq([:before_example_foo_bar]) + end + end + end + """ + When I run `rspec filter_example_hooks_with_strcmp_spec.rb` + Then the examples should all pass diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/.nav ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/.nav --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/.nav 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/.nav 2016-02-18 22:33:38.000000000 +0000 @@ -40,6 +40,7 @@ - run_all_when_everything_filtered.feature - configuration: - read_options_from_file.feature + - color.feature - fail_fast.feature - custom_settings.feature - alias_example_to.feature diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/support/send_sigint_during_bisect.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/support/send_sigint_during_bisect.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/features/support/send_sigint_during_bisect.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/features/support/send_sigint_during_bisect.rb 2016-02-18 22:33:38.000000000 +0000 @@ -5,8 +5,8 @@ BisectProgressFormatter = Class.new(remove_const :BisectProgressFormatter) do RSpec::Core::Formatters.register self - def bisect_round_finished(notification) - return super unless notification.round == 3 + def bisect_round_started(notification) + return super unless @round_count == 3 Process.kill("INT", Process.pid) # Process.kill is not a synchronous call, so to ensure the output diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/Filtering.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/Filtering.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/Filtering.md 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/Filtering.md 2016-02-18 22:33:38.000000000 +0000 @@ -159,3 +159,16 @@ ``` These declarations can also be overridden from the command line. + +## Silencing filter announcements + +By default, RSpec will print a message before your specs run indicating what filters are configured, for instance, it might print "Run options: include {:focus=>true}" if you set `config.filter_run_including :focus => true`. + +If you wish to prevent those messages from appearing in your spec output, you can set the `silence_filter_announcements` config setting to `true` like this: + +``` ruby +RSpec.configure do |c| + c.filter_run_including :foo => :bar + c.silence_filter_announcements = true +end +``` diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/Gemfile ruby-rspec-3.4.0c3e0m1s1/rspec-core/Gemfile --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/Gemfile 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/Gemfile 2016-02-18 22:33:38.000000000 +0000 @@ -29,7 +29,14 @@ end gem 'simplecov', '~> 0.8' -gem 'rubocop', "~> 0.23.0", :platform => [:ruby_19, :ruby_20, :ruby_21] + +# There is no platform :ruby_193 and Rubocop only supports >= 1.9.3 +unless RUBY_VERSION == "1.9.2" + gem "rubocop", + "~> 0.32.1", + :platform => [:ruby_19, :ruby_20, :ruby_21, :ruby_22] +end + gem 'test-unit', '~> 3.0' if RUBY_VERSION.to_f >= 2.2 eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom') diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/.gitignore ruby-rspec-3.4.0c3e0m1s1/rspec-core/.gitignore --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/.gitignore 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/.gitignore 2016-02-18 22:33:38.000000000 +0000 @@ -20,3 +20,4 @@ bundle .rspec-local spec/examples.txt +specs.out diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/backtrace_formatter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/backtrace_formatter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/backtrace_formatter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/backtrace_formatter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -31,6 +31,7 @@ end def format_backtrace(backtrace, options={}) + return [] unless backtrace return backtrace if options[:full_backtrace] || backtrace.empty? backtrace.map { |l| backtrace_line(l) }.compact. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/bisect/example_minimizer.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/bisect/example_minimizer.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/bisect/example_minimizer.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/bisect/example_minimizer.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,5 +1,3 @@ -RSpec::Support.require_rspec_core "bisect/subset_enumerator" - module RSpec module Core module Bisect @@ -18,20 +16,65 @@ def find_minimal_repro prep - self.remaining_ids = non_failing_example_ids + _, duration = track_duration do + bisect(non_failing_example_ids) + end + + notify(:bisect_complete, :duration => duration, + :original_non_failing_count => non_failing_example_ids.size, + :remaining_count => remaining_ids.size) + + remaining_ids + failed_example_ids + end + + def bisect(candidate_ids) + notify(:bisect_dependency_check_started) + if get_expected_failures_for?([]) + notify(:bisect_dependency_check_failed) + self.remaining_ids = [] + return + end + notify(:bisect_dependency_check_passed) + + bisect_over(candidate_ids) + end + + def bisect_over(candidate_ids) + return if candidate_ids.one? + + notify( + :bisect_round_started, + :candidate_range => example_range(candidate_ids), + :candidates_count => candidate_ids.size + ) - each_bisect_round do |subsets| - ids_to_ignore = subsets.find do |ids| + slice_size = (candidate_ids.length / 2.0).ceil + lhs, rhs = candidate_ids.each_slice(slice_size).to_a + + ids_to_ignore, duration = track_duration do + [lhs, rhs].find do |ids| get_expected_failures_for?(remaining_ids - ids) end + end - next :done unless ids_to_ignore - + if ids_to_ignore self.remaining_ids -= ids_to_ignore - notify(:bisect_ignoring_ids, :ids_to_ignore => ids_to_ignore, :remaining_ids => remaining_ids) + notify( + :bisect_round_ignoring_ids, + :ids_to_ignore => ids_to_ignore, + :ignore_range => example_range(ids_to_ignore), + :remaining_ids => remaining_ids, + :duration => duration + ) + bisect_over(candidate_ids - ids_to_ignore) + else + notify( + :bisect_round_detected_multiple_culprits, + :duration => duration + ) + bisect_over(lhs) + bisect_over(rhs) end - - currently_needed_ids end def currently_needed_ids @@ -43,8 +86,27 @@ "(Not yet enough information to provide any repro command)" end + # @private + # Convenience class for describing a subset of the candidate examples + ExampleRange = Struct.new(:start, :finish) do + def description + if start == finish + "example #{start}" + else + "examples #{start}-#{finish}" + end + end + end + private + def example_range(ids) + ExampleRange.new( + non_failing_example_ids.find_index(ids.first) + 1, + non_failing_example_ids.find_index(ids.last) + 1 + ) + end + def prep notify(:bisect_starting, :original_cli_args => runner.original_cli_args) @@ -52,6 +114,7 @@ original_results = runner.original_results @all_example_ids = original_results.all_example_ids @failed_example_ids = original_results.failed_example_ids + @remaining_ids = non_failing_example_ids end if @failed_example_ids.empty? @@ -70,7 +133,11 @@ def get_expected_failures_for?(ids) ids_to_run = ids + failed_example_ids - notify(:bisect_individual_run_start, :command => runner.repro_command_from(ids_to_run)) + notify( + :bisect_individual_run_start, + :command => runner.repro_command_from(ids_to_run), + :ids_to_run => ids_to_run + ) results, duration = track_duration { runner.run(ids_to_run) } notify(:bisect_individual_run_complete, :duration => duration, :results => results) @@ -79,34 +146,6 @@ (failed_example_ids & results.failed_example_ids) == failed_example_ids end - INFINITY = (1.0 / 0) # 1.8.7 doesn't define Float::INFINITY so we define our own... - - def each_bisect_round(&block) - last_round, duration = track_duration do - 1.upto(INFINITY) do |round| - break if :done == bisect_round(round, &block) - end - end - - notify(:bisect_complete, :round => last_round, :duration => duration, - :original_non_failing_count => non_failing_example_ids.size, - :remaining_count => remaining_ids.size) - end - - def bisect_round(round) - value, duration = track_duration do - subsets = SubsetEnumerator.new(remaining_ids) - notify(:bisect_round_started, :round => round, - :subset_size => subsets.subset_size, - :remaining_count => remaining_ids.size) - - yield subsets - end - - notify(:bisect_round_finished, :duration => duration, :round => round) - value - end - def track_duration start = ::RSpec::Core::Time.now [yield, ::RSpec::Core::Time.now - start] diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/bisect/subset_enumerator.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/bisect/subset_enumerator.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/bisect/subset_enumerator.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/bisect/subset_enumerator.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -module RSpec - module Core - module Bisect - # Enumerates each subset of the given list of ids that is half the - # size of the total list, so that hopefully we can discard half the - # list each repeatedly in order to our minimal repro case. - # @private - class SubsetEnumerator - include Enumerable - - def initialize(ids) - @ids = ids - end - - def subset_size - @subset_size ||= (@ids.size / 2.0).ceil - end - - def each - yielded = Set.new - slice_size = subset_size - combo_count = 1 - - while slice_size > 0 - @ids.each_slice(slice_size).to_a.combination(combo_count) do |combos| - subset = combos.flatten - next if yielded.include?(subset) - yield subset - yielded << subset - end - - slice_size /= 2 - combo_count *= 2 - end - end - end - end - end -end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/configuration_options.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/configuration_options.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/configuration_options.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/configuration_options.rb 2016-02-18 22:33:38.000000000 +0000 @@ -64,7 +64,7 @@ end def order(keys) - OPTIONS_ORDER.reverse.each do |key| + OPTIONS_ORDER.reverse_each do |key| keys.unshift(key) if keys.delete(key) end keys diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/configuration.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/configuration.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/configuration.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/configuration.rb 2016-02-18 22:33:38.000000000 +0000 @@ -4,7 +4,7 @@ module RSpec module Core - # rubocop:disable Style/ClassLength + # rubocop:disable Metrics/ClassLength # Stores runtime configuration information. # @@ -100,7 +100,11 @@ # # @note Other scripts invoking `rspec` indirectly will ignore this # setting. - add_setting :default_path + add_read_only_setting :default_path + def default_path=(path) + project_source_dirs << path + @default_path = path + end # @macro add_setting # Run examples over DRb (default: `false`). RSpec doesn't supply the DRb @@ -182,7 +186,8 @@ end # @macro add_setting - # Clean up and exit after the first failure (default: `false`). + # If specified, indicates the number of failures required before cleaning + # up and exit (default: `nil`). add_setting :fail_fast # @macro add_setting @@ -242,6 +247,16 @@ end # @macro add_setting + # Specifies which directories contain the source code for your project. + # When a failure occurs, RSpec looks through the backtrace to find a + # a line of source to print. It first looks for a line coming from + # one of the project source directories so that, for example, it prints + # the expectation or assertion call rather than the source code from + # the expectation or assertion framework. + # @return [Array] + add_setting :project_source_dirs + + # @macro add_setting # Report the times for the slowest examples (default: `false`). # Use this to specify the number of examples to include in the profile. add_setting :profile_examples @@ -293,6 +308,11 @@ # :cyan]` add_setting :detail_color + # @macro add_setting + # Don't print filter info i.e. "Run options: include {:focus=>true}" + # (default `false`). + add_setting :silence_filter_announcements + # Deprecated. This config option was added in RSpec 2 to pave the way # for this being the default behavior in RSpec 3. Now this option is # a no-op. @@ -313,6 +333,11 @@ # Currently this will place a mutex around memoized values such as let blocks. add_setting :threadsafe + # @macro add_setting + # Maximum count of failed source lines to display in the failure reports. + # (default `10`). + add_setting :max_displayed_failure_line_count + # @private add_setting :tty # @private @@ -348,6 +373,7 @@ @backtrace_formatter = BacktraceFormatter.new @default_path = 'spec' + @project_source_dirs = %w[ spec lib app ] @deprecation_stream = $stderr @output_stream = $stdout @reporter = nil @@ -367,6 +393,7 @@ @libs = [] @derived_metadata_blocks = FilterableItemRepository::QueryOptimized.new(:any?) @threadsafe = true + @max_displayed_failure_line_count = 10 define_built_in_hooks end @@ -575,7 +602,7 @@ end new_name, old_name = [framework_module, @mock_framework].map do |mod| - mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed + mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed end unless new_name == old_name @@ -703,19 +730,7 @@ end # Toggle output color. - # @attr true_or_false [Boolean] toggle color enabled - def color=(true_or_false) - return unless true_or_false - - if RSpec::Support::OS.windows? && !ENV['ANSICON'] - RSpec.warning "You must use ANSICON 1.31 or later " \ - "(http://adoxa.3eeweb.com/ansicon/) to use colour " \ - "on Windows" - @color = false - else - @color = true - end - end + attr_writer :color # @private def libs=(libs) @@ -881,7 +896,7 @@ # @private def spec_files_with_failures @spec_files_with_failures ||= last_run_statuses.inject(Set.new) do |files, (id, status)| - files << id.split(ON_SQUARE_BRACKETS).first if status == FAILED_STATUS + files << Example.parse_id(id).first if status == FAILED_STATUS files end.to_a end @@ -1282,6 +1297,15 @@ end # @private + def in_project_source_dir_regex + regexes = project_source_dirs.map do |dir| + /\A#{Regexp.escape(File.expand_path(dir))}\// + end + + Regexp.union(regexes) + end + + # @private if RUBY_VERSION.to_f >= 1.9 # @private def safe_include(mod, host) @@ -1322,6 +1346,16 @@ # @private def load_spec_files + # Note which spec files world is already aware of. + # This is generally only needed for when the user runs + # `ruby path/to/spec.rb` (and loads `rspec/autorun`) -- + # in that case, the spec file was loaded by `ruby` and + # isn't loaded by us here so we only know about it because + # of an example group being registered in it. + RSpec.world.registered_example_group_files.each do |f| + loaded_spec_files << f # the registered files are already expended absolute paths + end + files_to_run.uniq.each do |f| file = File.expand_path(f) load file @@ -1428,6 +1462,25 @@ $VERBOSE end + # @private + RAISE_ERROR_WARNING_NOTIFIER = lambda { |message| raise message } + + # Turns warnings into errors. This can be useful when + # you want RSpec to run in a 'strict' no warning situation. + # + # @example + # + # RSpec.configure do |rspec| + # rspec.raise_on_warning = true + # end + def raise_on_warning=(value) + if value + RSpec::Support.warning_notifier = RAISE_ERROR_WARNING_NOTIFIER + else + RSpec::Support.warning_notifier = RSpec::Support::DEFAULT_WARNING_NOTIFIER + end + end + # Exposes the current running example via the named # helper method. RSpec 2.x exposed this via `example`, # but in RSpec 3.0, the example is instead exposed via @@ -1638,6 +1691,17 @@ @hooks ||= HookCollections.new(self, FilterableItemRepository::QueryOptimized) end + # Invokes block before defining an example group + def on_example_group_definition(&block) + on_example_group_definition_callbacks << block + end + + # @api private + # Returns an array of blocks to call before defining an example group + def on_example_group_definition_callbacks + @on_example_group_definition_callbacks ||= [] + end + private def handle_suite_hook(args, collection, append_or_prepend, hook_type, block) @@ -1714,18 +1778,16 @@ end end - # @private - ON_SQUARE_BRACKETS = /[\[\]]/ - def extract_location(path) match = /^(.*?)((?:\:\d+)+)$/.match(path) if match captures = match.captures - path, lines = captures[0], captures[1][1..-1].split(":").map { |n| n.to_i } + path = captures[0] + lines = captures[1][1..-1].split(":").map(&:to_i) filter_manager.add_location path, lines else - path, scoped_ids = path.split(ON_SQUARE_BRACKETS) + path, scoped_ids = Example.parse_id(path) filter_manager.add_ids(path, scoped_ids.split(/\s*,\s*/)) if scoped_ids end @@ -1745,7 +1807,7 @@ around(:example, :aggregate_failures => true) do |procsy| begin aggregate_failures(nil, :hide_backtrace => true, &procsy) - rescue Exception => exception + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => exception procsy.example.set_aggregate_failures_exception(exception) end end @@ -1802,6 +1864,6 @@ @spec_files_with_failures = nil end end - # rubocop:enable Style/ClassLength + # rubocop:enable Metrics/ClassLength end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example_group.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example_group.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example_group.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example_group.rb 2016-02-18 22:33:38.000000000 +0000 @@ -2,6 +2,7 @@ module RSpec module Core + # rubocop:disable Metrics/ClassLength # ExampleGroup and {Example} are the main structural elements of # rspec-core. Consider this example: # @@ -340,6 +341,27 @@ find_and_eval_shared("examples", name, caller.first, *args, &block) end + # Clear memoized values when adding/removing examples + # @private + def self.reset_memoized + @descendant_filtered_examples = nil + @_descendants = nil + @parent_groups = nil + @declaration_locations = nil + end + + # Adds an example to the example group + def self.add_example(example) + reset_memoized + examples << example + end + + # Removes an example from the example group + def self.remove_example(example) + reset_memoized + examples.delete example + end + # @private def self.find_and_eval_shared(label, name, inclusion_location, *args, &customization_block) shared_block = RSpec.world.shared_example_group_registry.find(parent_groups, name) @@ -524,9 +546,9 @@ rescue Pending::SkipDeclaredInExample => ex for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) } true - rescue Exception => ex - RSpec.world.wants_to_quit = true if fail_fast? + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) } + RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met? false ensure run_after_context_hooks(new('after(:context) hook')) if should_run_context_hooks @@ -557,7 +579,9 @@ instance = new(example.inspect_output) set_ivars(instance, before_context_ivars) succeeded = example.run(instance, reporter) - RSpec.world.wants_to_quit = true if fail_fast? && !succeeded + if !succeeded && reporter.fail_fast_limit_met? + RSpec.world.wants_to_quit = true + end succeeded end.all? end @@ -575,15 +599,10 @@ end # @private - def self.fail_fast? - RSpec.configuration.fail_fast? - end - - # @private - def self.declaration_line_numbers - @declaration_line_numbers ||= [metadata[:line_number]] + - examples.map { |e| e.metadata[:line_number] } + - FlatMap.flat_map(children, &:declaration_line_numbers) + def self.declaration_locations + @declaration_locations ||= [Metadata.location_tuple_from(metadata)] + + examples.map { |e| Metadata.location_tuple_from(e.metadata) } + + FlatMap.flat_map(children, &:declaration_locations) end # @return [String] the unique id of this example group. Pass @@ -671,6 +690,7 @@ super end end + # rubocop:enable Metrics/ClassLength # @private # Unnamed example group used by `SuiteHookContext`. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example.rb 2016-02-18 22:33:38.000000000 +0000 @@ -118,6 +118,30 @@ @id ||= Metadata.id_from(metadata) end + # @private + def self.parse_id(id) + # http://rubular.com/r/OMZSAPcAfn + id.match(/\A(.*?)(?:\[([\d\s:,]+)\])?\z/).captures + end + + # Duplicates the example and overrides metadata with the provided + # hash. + # + # @param metadata_overrides [Hash] the hash to override the example metadata + # @return [Example] a duplicate of the example with modified metadata + def duplicate_with(metadata_overrides={}) + new_metadata = metadata.clone.merge(metadata_overrides) + + RSpec::Core::Metadata::RESERVED_KEYS.each do |reserved_key| + new_metadata.delete reserved_key + end + + # don't clone the example group because the new example + # must belong to the same example group (not a clone). + Example.new(example_group, description.clone, + new_metadata, new_metadata[:block]) + end + # @attr_reader # # Returns the first exception raised in the context of running this @@ -170,6 +194,12 @@ @reporter = RSpec::Core::NullReporter end + # Provide a human-readable representation of this class + def inspect + "#<#{self.class.name} #{description.inspect}>" + end + alias to_s inspect + # @return [RSpec::Core::Reporter] the current reporter for the example attr_reader :reporter @@ -215,14 +245,14 @@ rescue Pending::SkipDeclaredInExample # no-op, required metadata has already been set by the `skip` # method. - rescue Exception => e + rescue AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt => e set_exception(e) ensure run_after_example end end end - rescue Exception => e + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e set_exception(e) ensure @example_group_instance = nil # if you love something... let it go @@ -230,9 +260,24 @@ finish(reporter) ensure + execution_result.ensure_timing_set(clock) RSpec.current_example = nil end + if RSpec::Support::Ruby.jruby? || RUBY_VERSION.to_f < 1.9 + # :nocov: + # For some reason, rescuing `Support::AllExceptionsExceptOnesWeMustNotRescue` + # in place of `Exception` above can cause the exit status to be the wrong + # thing. I have no idea why. See: + # https://github.com/rspec/rspec-core/pull/2063#discussion_r38284978 + # @private + AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt = Exception + # :nocov: + else + # @private + AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt = Support::AllExceptionsExceptOnesWeMustNotRescue + end + # Wraps both a `Proc` and an {Example} for use in {Hooks#around # around} hooks. In around hooks we need to yield this special # kind of object (rather than the raw {Example}) because when @@ -256,13 +301,15 @@ attr_reader :example Example.public_instance_methods(false).each do |name| - next if name.to_sym == :run || name.to_sym == :inspect + name_sym = name.to_sym + next if name_sym == :run || name_sym == :inspect || name_sym == :to_s define_method(name) { |*a, &b| @example.__send__(name, *a, &b) } end Proc.public_instance_methods(false).each do |name| - next if name.to_sym == :call || name.to_sym == :inspect || name.to_sym == :to_proc + name_sym = name.to_sym + next if name_sym == :call || name_sym == :inspect || name_sym == :to_s || name_sym == :to_proc define_method(name) { |*a, &b| @proc.__send__(name, *a, &b) } end @@ -386,7 +433,7 @@ def with_around_example_hooks hooks.run(:around, :example, self) { yield } - rescue Exception => e + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e set_exception(e) end @@ -398,6 +445,7 @@ def finish(reporter) pending_message = execution_result.pending_message + reporter.example_finished(self) if @exception record_finished :failed execution_result.exception = @exception @@ -442,7 +490,7 @@ def verify_mocks @example_group_instance.verify_mocks_for_rspec if mocks_need_verification? - rescue Exception => e + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e set_exception(e) end @@ -461,7 +509,7 @@ def generate_description RSpec::Matchers.generated_description - rescue Exception => e + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e location_description + " (Got an error when generating description " \ "from matcher: #{e.class}: #{e.message} -- #{e.backtrace.first})" end @@ -518,13 +566,23 @@ # @api private # Records the finished status of the example. def record_finished(status, finished_at) - self.status = status - self.finished_at = finished_at - self.run_time = (finished_at - started_at).to_f + self.status = status + calculate_run_time(finished_at) + end + + # @api private + # Populates finished_at and run_time if it has not yet been set + def ensure_timing_set(clock) + calculate_run_time(clock.now) unless finished_at end private + def calculate_run_time(finished_at) + self.finished_at = finished_at + self.run_time = (finished_at - started_at).to_f + end + # For backwards compatibility we present `status` as a string # when presenting the legacy hash interface. def hash_for_delegation diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example_status_persister.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example_status_persister.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/example_status_persister.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/example_status_persister.rb 2016-02-18 22:33:38.000000000 +0000 @@ -21,24 +21,28 @@ end def persist - write dumped_statuses + RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(@file_name)) + File.open(@file_name, File::RDWR | File::CREAT) do |f| + # lock the file while reading / persisting to avoid a race + # condition where parallel or unrelated spec runs race to + # update the same file + f.flock(File::LOCK_EX) + unparsed_previous_runs = f.read + f.rewind + f.write(dump_statuses(unparsed_previous_runs)) + f.flush + f.truncate(f.pos) + end end private - def write(statuses) - RSpec::Support::DirectoryMaker.mkdir_p(File.dirname(@file_name)) - File.open(@file_name, "w") { |f| f.write(statuses) } - end - - def dumped_statuses + def dump_statuses(unparsed_previous_runs) + statuses_from_previous_runs = ExampleStatusParser.parse(unparsed_previous_runs) + merged_statuses = ExampleStatusMerger.merge(statuses_from_this_run, statuses_from_previous_runs) ExampleStatusDumper.dump(merged_statuses) end - def merged_statuses - ExampleStatusMerger.merge(statuses_from_this_run, statuses_from_previous_runs) - end - def statuses_from_this_run @examples.map do |ex| result = ex.execution_result @@ -50,10 +54,6 @@ } end end - - def statuses_from_previous_runs - self.class.load_from(@file_name) - end end # Merges together a list of example statuses from this run @@ -130,7 +130,7 @@ end def sort_value_from(example) - file, scoped_id = example.fetch(:example_id).split(Configuration::ON_SQUARE_BRACKETS) + file, scoped_id = Example.parse_id(example.fetch(:example_id)) [file, *scoped_id.split(":").map(&method(:Integer))] end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/bisect_progress_formatter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/bisect_progress_formatter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/bisect_progress_formatter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/bisect_progress_formatter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -9,10 +9,14 @@ # We've named all events with a `bisect_` prefix to prevent naming collisions. Formatters.register self, :bisect_starting, :bisect_original_run_complete, :bisect_round_started, :bisect_individual_run_complete, - :bisect_round_finished, :bisect_complete, :bisect_repro_command, - :bisect_failed, :bisect_aborted + :bisect_complete, :bisect_repro_command, + :bisect_failed, :bisect_aborted, + :bisect_round_ignoring_ids, :bisect_round_detected_multiple_culprits, + :bisect_dependency_check_started, :bisect_dependency_check_passed, + :bisect_dependency_check_failed def bisect_starting(notification) + @round_count = 0 options = notification.original_cli_args.join(' ') output.puts "Bisect started using options: #{options.inspect}" output.print "Running suite to find failures..." @@ -26,17 +30,35 @@ output.puts "Starting bisect with #{failures} and #{non_failures}." end + def bisect_dependency_check_started(_notification) + output.print "Checking that failure(s) are order-dependent.." + end + + def bisect_dependency_check_passed(_notification) + output.puts " failure appears to be order-dependent" + end + + def bisect_dependency_check_failed(_notification) + output.puts " failure(s) do not require any non-failures to run first" + end + def bisect_round_started(notification, include_trailing_space=true) - search_desc = Helpers.pluralize( - notification.subset_size, "non-failing example" - ) + @round_count += 1 + range_desc = notification.candidate_range.description - output.print "\nRound #{notification.round}: searching for #{search_desc}" \ - " (of #{notification.remaining_count}) to ignore:" + output.print "\nRound #{@round_count}: bisecting over non-failing #{range_desc}" output.print " " if include_trailing_space end - def bisect_round_finished(notification) + def bisect_round_ignoring_ids(notification) + range_desc = notification.ignore_range.description + + output.print " ignoring #{range_desc}" + output.print " (#{Helpers.format_duration(notification.duration)})" + end + + def bisect_round_detected_multiple_culprits(notification) + output.print " multiple culprits detected - splitting candidates" output.print " (#{Helpers.format_duration(notification.duration)})" end @@ -71,7 +93,7 @@ # Designed to provide details for us when we need to troubleshoot bisect bugs. class BisectDebugFormatter < BisectProgressFormatter Formatters.register self, :bisect_original_run_complete, :bisect_individual_run_start, - :bisect_individual_run_complete, :bisect_round_finished, :bisect_ignoring_ids + :bisect_individual_run_complete, :bisect_round_ignoring_ids def bisect_original_run_complete(notification) output.puts " (#{Helpers.format_duration(notification.duration)})" @@ -88,20 +110,27 @@ output.print " (#{Helpers.format_duration(notification.duration)})" end - def bisect_round_started(notification) - super(notification, false) + def bisect_dependency_check_passed(_notification) + output.print "\n - Failure appears to be order-dependent" end - def bisect_round_finished(notification) - output.print "\n - Round finished" - super + def bisect_dependency_check_failed(_notification) + output.print "\n - Failure is not order-dependent" end - def bisect_ignoring_ids(notification) + def bisect_round_started(notification) + super(notification, false) + end + + def bisect_round_ignoring_ids(notification) output.print "\n - #{describe_ids 'Examples we can safely ignore', notification.ids_to_ignore}" output.print "\n - #{describe_ids 'Remaining non-failing examples', notification.remaining_ids}" end + def bisect_round_detected_multiple_culprits(_notification) + output.print "\n - Multiple culprits detected - splitting candidates" + end + private def describe_ids(description, ids) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/exception_presenter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/exception_presenter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/exception_presenter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/exception_presenter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,3 +1,7 @@ +# encoding: utf-8 +RSpec::Support.require_rspec_core "formatters/snippet_extractor" +RSpec::Support.require_rspec_support "encoded_string" + module RSpec module Core module Formatters @@ -11,7 +15,7 @@ @exception = exception @example = example @message_color = options.fetch(:message_color) { RSpec.configuration.failure_color } - @description = options.fetch(:description_formatter) { Proc.new { example.full_description } }.call(self) + @description = options.fetch(:description) { example.full_description } @detail_formatter = options.fetch(:detail_formatter) { Proc.new {} } @extra_detail_formatter = options.fetch(:extra_detail_formatter) { Proc.new {} } @backtrace_formatter = options.fetch(:backtrace_formatter) { RSpec.configuration.backtrace_formatter } @@ -30,8 +34,36 @@ end end - def formatted_backtrace - backtrace_formatter.format_backtrace(exception_backtrace, example.metadata) + def formatted_backtrace(exception=@exception) + backtrace_formatter.format_backtrace(exception.backtrace, example.metadata) + + formatted_cause(exception) + end + + if RSpec::Support::RubyFeatures.supports_exception_cause? + def formatted_cause(exception) + last_cause = final_exception(exception) + cause = [] + + if exception.cause + cause << '------------------' + cause << '--- Caused by: ---' + cause << "#{exception_class_name(last_cause)}:" unless exception_class_name(last_cause) =~ /RSpec/ + + encoded_string(last_cause.message.to_s).split("\n").each do |line| + cause << " #{line}" + end + + cause << (" #{backtrace_formatter.format_backtrace(last_cause.backtrace, example.metadata).first}") + end + + cause + end + else + # :nocov: + def formatted_cause(_) + [] + end + # :nocov: end def colorized_formatted_backtrace(colorizer=::RSpec::Core::Formatters::ConsoleCodes) @@ -41,24 +73,33 @@ end def fully_formatted(failure_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes) - alignment_basis = "#{' ' * @indentation}#{failure_number}) " - indentation = ' ' * alignment_basis.length - - "\n#{alignment_basis}#{description_and_detail(colorizer, indentation)}" \ - "\n#{formatted_message_and_backtrace(colorizer, indentation)}" \ - "#{extra_detail_formatter.call(failure_number, colorizer, indentation)}" + lines = fully_formatted_lines(failure_number, colorizer) + lines.join("\n") << "\n" end - def failure_slash_error_line - @failure_slash_error_line ||= "Failure/Error: #{read_failed_line.strip}" + def fully_formatted_lines(failure_number, colorizer) + lines = [ + description, + detail_formatter.call(example, colorizer), + formatted_message_and_backtrace(colorizer), + extra_detail_formatter.call(failure_number, colorizer), + ].compact.flatten + + lines = indent_lines(lines, failure_number) + lines.unshift("") + lines end private - def description_and_detail(colorizer, indentation) - detail = detail_formatter.call(example, colorizer, indentation) - return (description || detail) unless description && detail - "#{description}\n#{indentation}#{detail}" + def final_exception(exception, previous=[]) + cause = exception.cause + if cause && !previous.include?(cause) + previous << cause + final_exception(cause, previous) + else + exception + end end if String.method_defined?(:encoding) @@ -80,23 +121,71 @@ # :nocov: end - def exception_class_name + def indent_lines(lines, failure_number) + alignment_basis = "#{' ' * @indentation}#{failure_number}) " + indentation = ' ' * alignment_basis.length + + lines.each_with_index.map do |line, index| + if index == 0 + "#{alignment_basis}#{line}" + elsif line.empty? + line + else + "#{indentation}#{line}" + end + end + end + + def exception_class_name(exception=@exception) name = exception.class.name.to_s name = "(anonymous error class)" if name == '' name end def failure_lines - @failure_lines ||= - begin - lines = [] - lines << failure_slash_error_line unless (description == failure_slash_error_line) - lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/ - encoded_string(exception.message.to_s).split("\n").each do |line| - lines << " #{line}" - end - lines + @failure_lines ||= [].tap do |lines| + lines.concat(failure_slash_error_lines) + + sections = [failure_slash_error_lines, exception_lines] + if sections.any? { |section| section.size > 1 } && !exception_lines.first.empty? + lines << '' end + + lines.concat(exception_lines) + lines.concat(extra_failure_lines) + end + end + + def failure_slash_error_lines + lines = read_failed_lines + if lines.count == 1 + lines[0] = "Failure/Error: #{lines[0].strip}" + else + least_indentation = SnippetExtractor.least_indentation_from(lines) + lines = lines.map { |line| line.sub(/^#{least_indentation}/, ' ') } + lines.unshift('Failure/Error:') + end + lines + end + + def exception_lines + lines = [] + lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/ + encoded_string(exception.message.to_s).split("\n").each do |line| + lines << (line.empty? ? line : " #{line}") + end + lines + end + + def extra_failure_lines + @extra_failure_lines ||= begin + lines = Array(example.metadata[:extra_failure_lines]) + unless lines.empty? + lines.unshift('') + lines.push('') + end + lines + end end def add_shared_group_lines(lines, colorizer) @@ -109,42 +198,41 @@ lines end - def read_failed_line + def read_failed_lines matching_line = find_failed_line unless matching_line - return "Unable to find matching line from backtrace" + return ["Unable to find matching line from backtrace"] end file_path, line_number = matching_line.match(/(.+?):(\d+)(|:\d+)/)[1..2] - - if File.exist?(file_path) - File.readlines(file_path)[line_number.to_i - 1] || - "Unable to find matching line in #{file_path}" - else - "Unable to find #{file_path} to read failed line" - end + max_line_count = RSpec.configuration.max_displayed_failure_line_count + lines = SnippetExtractor.extract_expression_lines_at(file_path, line_number.to_i, max_line_count) + RSpec.world.source_cache.syntax_highlighter.highlight(lines) + rescue SnippetExtractor::NoSuchFileError + ["Unable to find #{file_path} to read failed line"] + rescue SnippetExtractor::NoSuchLineError + ["Unable to find matching line in #{file_path}"] rescue SecurityError - "Unable to read failed line" + ["Unable to read failed line"] end def find_failed_line - example_path = example.metadata[:absolute_file_path].downcase + line_regex = RSpec.configuration.in_project_source_dir_regex + loaded_spec_files = RSpec.configuration.loaded_spec_files + exception_backtrace.find do |line| next unless (line_path = line[/(.+?):(\d+)(|:\d+)/, 1]) - File.expand_path(line_path).downcase == example_path - end + path = File.expand_path(line_path) + loaded_spec_files.include?(path) || path =~ line_regex + end || exception_backtrace.first end - def formatted_message_and_backtrace(colorizer, indentation) + def formatted_message_and_backtrace(colorizer) lines = colorized_message_lines(colorizer) + colorized_formatted_backtrace(colorizer) - - formatted = "" - - lines.each do |line| - formatted << RSpec::Support::EncodedString.new("#{indentation}#{line}\n", encoding_of(formatted)) + encoding = encoding_of("") + lines.map do |line| + RSpec::Support::EncodedString.new(line, encoding) end - - formatted end def exception_backtrace @@ -180,9 +268,9 @@ def pending_options if @execution_result.pending_fixed? { - :description_formatter => Proc.new { "#{@example.full_description} FIXED" }, - :message_color => RSpec.configuration.fixed_color, - :failure_lines => [ + :description => "#{@example.full_description} FIXED", + :message_color => RSpec.configuration.fixed_color, + :failure_lines => [ "Expected pending '#{@execution_result.pending_message}' to fail. No Error was raised." ] } @@ -205,8 +293,6 @@ options[:message_color]) ) - options[:description_formatter] &&= Proc.new {} - return options unless exception.aggregation_metadata[:hide_backtrace] options[:backtrace_formatter] = EmptyBacktraceFormatter options @@ -217,7 +303,7 @@ end def multiple_exception_summarizer(exception, prior_detail_formatter, color) - lambda do |example, colorizer, indentation| + lambda do |example, colorizer| summary = if exception.aggregation_metadata[:hide_backtrace] # Since the backtrace is hidden, the subfailures will come # immediately after this, and using `:` will read well. @@ -230,27 +316,30 @@ summary = colorizer.wrap(summary, color || RSpec.configuration.failure_color) return summary unless prior_detail_formatter - "#{prior_detail_formatter.call(example, colorizer, indentation)}\n#{indentation}#{summary}" + [ + prior_detail_formatter.call(example, colorizer), + summary + ] end end def sub_failure_list_formatter(exception, message_color) common_backtrace_truncater = CommonBacktraceTruncater.new(exception) - lambda do |failure_number, colorizer, indentation| - exception.all_exceptions.each_with_index.map do |failure, index| + lambda do |failure_number, colorizer| + FlatMap.flat_map(exception.all_exceptions.each_with_index) do |failure, index| options = with_multiple_error_options_as_needed( failure, - :description_formatter => :failure_slash_error_line.to_proc, - :indentation => indentation.length, + :description => nil, + :indentation => 0, :message_color => message_color || RSpec.configuration.failure_color, :skip_shared_group_trace => true ) failure = common_backtrace_truncater.with_truncated_backtrace(failure) presenter = ExceptionPresenter.new(failure, @example, options) - presenter.fully_formatted("#{failure_number}.#{index + 1}", colorizer) - end.join + presenter.fully_formatted_lines("#{failure_number}.#{index + 1}", colorizer) + end end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/helpers.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/helpers.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/helpers.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/helpers.rb 2016-02-18 22:33:38.000000000 +0000 @@ -92,7 +92,7 @@ # Given a list of example ids, organizes them into a compact, ordered list. def self.organize_ids(ids) grouped = ids.inject(Hash.new { |h, k| h[k] = [] }) do |hash, id| - file, id = id.split(Configuration::ON_SQUARE_BRACKETS) + file, id = Example.parse_id(id) hash[file] << id hash end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_formatter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_formatter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_formatter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_formatter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -137,12 +137,12 @@ # spec. For example, you could output links to images or other files # produced during the specs. def extra_failure_content(failure) - RSpec::Support.require_rspec_core "formatters/snippet_extractor" + RSpec::Support.require_rspec_core "formatters/html_snippet_extractor" backtrace = (failure.exception.backtrace || []).map do |line| RSpec.configuration.backtrace_formatter.backtrace_line(line) end backtrace.compact! - @snippet_extractor ||= SnippetExtractor.new + @snippet_extractor ||= HtmlSnippetExtractor.new "
#{@snippet_extractor.snippet(backtrace)}
" end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_printer.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_printer.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_printer.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_printer.rb 2016-02-18 22:33:38.000000000 +0000 @@ -33,10 +33,10 @@ "#{formatted_run_time}s" end - # rubocop:disable Style/ParameterLists + # rubocop:disable Metrics/ParameterLists def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content) - # rubocop:enable Style/ParameterLists + # rubocop:enable Metrics/ParameterLists formatted_run_time = "%.5f" % run_time @output.puts "
" @@ -139,7 +139,6 @@ EOF # rubocop:enable LineLength - # rubocop:disable LineLength GLOBAL_SCRIPTS = <<-EOF function addClass(element_id, classname) { diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_snippet_extractor.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_snippet_extractor.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/html_snippet_extractor.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/html_snippet_extractor.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,116 @@ +module RSpec + module Core + module Formatters + # @api private + # + # Extracts code snippets by looking at the backtrace of the passed error + # and applies synax highlighting and line numbers using html. + class HtmlSnippetExtractor + # @private + module NullConverter + def self.convert(code) + %Q(#{code}\n# Install the coderay gem to get syntax highlighting) + end + end + + # @private + module CoderayConverter + def self.convert(code) + CodeRay.scan(code, :ruby).html(:line_numbers => false) + end + end + + # rubocop:disable Style/ClassVars + @@converter = NullConverter + begin + require 'coderay' + @@converter = CoderayConverter + # rubocop:disable Lint/HandleExceptions + rescue LoadError + # it'll fall back to the NullConverter assigned above + # rubocop:enable Lint/HandleExceptions + end + + # rubocop:enable Style/ClassVars + + # @api private + # + # Extract lines of code corresponding to a backtrace. + # + # @param backtrace [String] the backtrace from a test failure + # @return [String] highlighted code snippet indicating where the test + # failure occured + # + # @see #post_process + def snippet(backtrace) + raw_code, line = snippet_for(backtrace[0]) + highlighted = @@converter.convert(raw_code) + post_process(highlighted, line) + end + # rubocop:enable Style/ClassVars + + # @api private + # + # Create a snippet from a line of code. + # + # @param error_line [String] file name with line number (i.e. + # 'foo_spec.rb:12') + # @return [String] lines around the target line within the file + # + # @see #lines_around + def snippet_for(error_line) + if error_line =~ /(.*):(\d+)/ + file = Regexp.last_match[1] + line = Regexp.last_match[2].to_i + [lines_around(file, line), line] + else + ["# Couldn't get snippet for #{error_line}", 1] + end + end + + # @api private + # + # Extract lines of code centered around a particular line within a + # source file. + # + # @param file [String] filename + # @param line [Fixnum] line number + # @return [String] lines around the target line within the file (2 above + # and 1 below). + def lines_around(file, line) + if File.file?(file) + lines = File.read(file).split("\n") + min = [0, line - 3].max + max = [line + 1, lines.length - 1].min + selected_lines = [] + selected_lines.join("\n") + lines[min..max].join("\n") + else + "# Couldn't get snippet for #{file}" + end + rescue SecurityError + "# Couldn't get snippet for #{file}" + end + + # @api private + # + # Adds line numbers to all lines and highlights the line where the + # failure occurred using html `span` tags. + # + # @param highlighted [String] syntax-highlighted snippet surrounding the + # offending line of code + # @param offending_line [Fixnum] line where failure occured + # @return [String] completed snippet + def post_process(highlighted, offending_line) + new_lines = [] + highlighted.split("\n").each_with_index do |line, i| + new_line = "#{offending_line + i - 2}#{line}" + new_line = "#{new_line}" if i == 2 + new_lines << new_line + end + new_lines.join("\n") + end + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/protocol.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/protocol.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/protocol.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/protocol.rb 2016-02-18 22:33:38.000000000 +0000 @@ -66,6 +66,15 @@ # @param notification [ExampleNotification] containing example subclass # of `RSpec::Core::Example` + # @method example_finished + # @api public + # @group Example Notifications + # + # Invoked at the end of the execution of each example. + # + # @param notification [ExampleNotification] containing example subclass + # of `RSpec::Core::Example` + # @method example_passed # @api public # @group Example Notifications diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/snippet_extractor.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/snippet_extractor.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters/snippet_extractor.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters/snippet_extractor.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,114 +1,134 @@ +RSpec::Support.require_rspec_core "source" + module RSpec module Core module Formatters - # @api private - # - # Extracts code snippets by looking at the backtrace of the passed error - # and applies synax highlighting and line numbers using html. + # @private class SnippetExtractor - # @private - module NullConverter - def self.convert(code) - %Q(#{code}\n# Install the coderay gem to get syntax highlighting) - end - end + NoSuchFileError = Class.new(StandardError) + NoSuchLineError = Class.new(StandardError) - # @private - module CoderayConverter - def self.convert(code) - CodeRay.scan(code, :ruby).html(:line_numbers => false) - end + def self.extract_line_at(file_path, line_number) + source = source_from_file(file_path) + line = source.lines[line_number - 1] + raise NoSuchLineError unless line + line end - # rubocop:disable Style/ClassVars - @@converter = NullConverter - begin - require 'coderay' - @@converter = CoderayConverter - # rubocop:disable Lint/HandleExceptions - rescue LoadError - # it'll fall back to the NullConverter assigned above - # rubocop:enable Lint/HandleExceptions + def self.source_from_file(path) + raise NoSuchFileError unless File.exist?(path) + RSpec.world.source_cache.source_from_file(path) end - # rubocop:enable Style/ClassVars + if RSpec::Support::RubyFeatures.ripper_supported? + NoExpressionAtLineError = Class.new(StandardError) - # @api private - # - # Extract lines of code corresponding to a backtrace. - # - # @param backtrace [String] the backtrace from a test failure - # @return [String] highlighted code snippet indicating where the test - # failure occured - # - # @see #post_process - def snippet(backtrace) - raw_code, line = snippet_for(backtrace[0]) - highlighted = @@converter.convert(raw_code) - post_process(highlighted, line) - end - # rubocop:enable Style/ClassVars + attr_reader :source, :beginning_line_number, :max_line_count - # @api private - # - # Create a snippet from a line of code. - # - # @param error_line [String] file name with line number (i.e. - # 'foo_spec.rb:12') - # @return [String] lines around the target line within the file - # - # @see #lines_around - def snippet_for(error_line) - if error_line =~ /(.*):(\d+)/ - file = Regexp.last_match[1] - line = Regexp.last_match[2].to_i - [lines_around(file, line), line] - else - ["# Couldn't get snippet for #{error_line}", 1] + def self.extract_expression_lines_at(file_path, beginning_line_number, max_line_count=nil) + if max_line_count == 1 + [extract_line_at(file_path, beginning_line_number)] + else + source = source_from_file(file_path) + new(source, beginning_line_number, max_line_count).expression_lines + end end - end - # @api private - # - # Extract lines of code centered around a particular line within a - # source file. - # - # @param file [String] filename - # @param line [Fixnum] line number - # @return [String] lines around the target line within the file (2 above - # and 1 below). - def lines_around(file, line) - if File.file?(file) - lines = File.read(file).split("\n") - min = [0, line - 3].max - max = [line + 1, lines.length - 1].min - selected_lines = [] - selected_lines.join("\n") - lines[min..max].join("\n") - else - "# Couldn't get snippet for #{file}" + def initialize(source, beginning_line_number, max_line_count=nil) + @source = source + @beginning_line_number = beginning_line_number + @max_line_count = max_line_count + end + + def expression_lines + line_range = line_range_of_expression + + if max_line_count && line_range.count > max_line_count + line_range = (line_range.begin)..(line_range.begin + max_line_count - 1) + end + + source.lines[(line_range.begin - 1)..(line_range.end - 1)] + rescue SyntaxError, NoExpressionAtLineError + [self.class.extract_line_at(source.path, beginning_line_number)] + end + + private + + def line_range_of_expression + @line_range_of_expression ||= begin + line_range = line_range_of_location_nodes_in_expression + initial_unclosed_tokens = unclosed_tokens_in_line_range(line_range) + unclosed_tokens = initial_unclosed_tokens + + until (initial_unclosed_tokens & unclosed_tokens).empty? + line_range = (line_range.begin)..(line_range.end + 1) + unclosed_tokens = unclosed_tokens_in_line_range(line_range) + end + + line_range + end end - rescue SecurityError - "# Couldn't get snippet for #{file}" - end - # @api private - # - # Adds line numbers to all lines and highlights the line where the - # failure occurred using html `span` tags. - # - # @param highlighted [String] syntax-highlighted snippet surrounding the - # offending line of code - # @param offending_line [Fixnum] line where failure occured - # @return [String] completed snippet - def post_process(highlighted, offending_line) - new_lines = [] - highlighted.split("\n").each_with_index do |line, i| - new_line = "#{offending_line + i - 2}#{line}" - new_line = "#{new_line}" if i == 2 - new_lines << new_line + def unclosed_tokens_in_line_range(line_range) + tokens = FlatMap.flat_map(line_range) do |line_number| + source.tokens_by_line_number[line_number] + end + + tokens.each_with_object([]) do |token, unclosed_tokens| + if token.opening? + unclosed_tokens << token + else + index = unclosed_tokens.rindex do |unclosed_token| + unclosed_token.closed_by?(token) + end + unclosed_tokens.delete_at(index) if index + end + end end - new_lines.join("\n") + + def line_range_of_location_nodes_in_expression + line_numbers = expression_node.each_with_object(Set.new) do |node, set| + set << node.location.line if node.location + end + + line_numbers.min..line_numbers.max + end + + def expression_node + raise NoExpressionAtLineError if location_nodes_at_beginning_line.empty? + + @expression_node ||= begin + common_ancestor_nodes = location_nodes_at_beginning_line.map do |node| + node.each_ancestor.to_a + end.reduce(:&) + + common_ancestor_nodes.find { |node| expression_outmost_node?(node) } + end + end + + def expression_outmost_node?(node) + return true unless node.parent + return false if node.type.to_s.start_with?('@') + ![node, node.parent].all? do |n| + # See `Ripper::PARSER_EVENTS` for the complete list of sexp types. + type = n.type.to_s + type.end_with?('call') || type.start_with?('method_add_') + end + end + + def location_nodes_at_beginning_line + source.nodes_by_line_number[beginning_line_number] + end + else + # :nocov: + def self.extract_expression_lines_at(file_path, beginning_line_number, *) + [extract_line_at(file_path, beginning_line_number)] + end + # :nocov: + end + + def self.least_indentation_from(lines) + lines.map { |line| line[/^[ \t]*/] }.min end end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/formatters.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/formatters.rb 2016-02-18 22:33:38.000000000 +0000 @@ -73,6 +73,7 @@ autoload :ProfileFormatter, 'rspec/core/formatters/profile_formatter' autoload :JsonFormatter, 'rspec/core/formatters/json_formatter' autoload :BisectFormatter, 'rspec/core/formatters/bisect_formatter' + autoload :ExceptionPresenter, 'rspec/core/formatters/exception_presenter' # Register the formatter class # @param formatter_class [Class] formatter class to register diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/hooks.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/hooks.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/hooks.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/hooks.rb 2016-02-18 22:33:38.000000000 +0000 @@ -362,7 +362,7 @@ class AfterHook < Hook def run(example) example.instance_exec(example, &block) - rescue Exception => ex + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex example.set_exception(ex) end end @@ -371,7 +371,7 @@ class AfterContextHook < Hook def run(example) example.instance_exec(example, &block) - rescue Exception => e + rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e # TODO: Come up with a better solution for this. RSpec.configuration.reporter.message <<-EOS diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/memoized_helpers.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/memoized_helpers.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/memoized_helpers.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/memoized_helpers.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -require 'rspec/core/reentrant_mutex' +RSpec::Support.require_rspec_support 'reentrant_mutex' module RSpec module Core @@ -148,7 +148,7 @@ class ThreadsafeMemoized def initialize @memoized = {} - @mutex = ReentrantMutex.new + @mutex = Support::ReentrantMutex.new end def fetch_or_store(key) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/metadata_filter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/metadata_filter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/metadata_filter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/metadata_filter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -15,22 +15,19 @@ # @private def filter_applies?(key, value, metadata) silence_metadata_example_group_deprecations do - return filter_applies_to_any_value?(key, value, metadata) if Array === metadata[key] && !(Proc === value) - return location_filter_applies?(value, metadata) if key == :locations - return id_filter_applies?(value, metadata) if key == :ids - return filters_apply?(key, value, metadata) if Hash === value + return location_filter_applies?(value, metadata) if key == :locations + return id_filter_applies?(value, metadata) if key == :ids + return filters_apply?(key, value, metadata) if Hash === value return false unless metadata.key?(key) + return true if TrueClass === value && !!metadata[key] + return filter_applies_to_any_value?(key, value, metadata) if Array === metadata[key] && !(Proc === value) case value when Regexp metadata[key] =~ value when Proc - case value.arity - when 0 then value.call - when 2 then value.call(metadata[key], metadata) - else value.call(metadata[key]) - end + proc_filter_applies?(key, value, metadata) else metadata[key].to_s == value.to_s end @@ -52,23 +49,22 @@ end def location_filter_applies?(locations, metadata) - line_numbers = example_group_declaration_lines(locations, metadata) - line_number_filter_applies?(line_numbers, metadata) - end - - def line_number_filter_applies?(line_numbers, metadata) - preceding_declaration_lines = line_numbers.map { |n| RSpec.world.preceding_declaration_line(n) } - !(relevant_line_numbers(metadata) & preceding_declaration_lines).empty? - end + Metadata.ascend(metadata).any? do |meta| + file_path = meta[:absolute_file_path] + line_num = meta[:line_number] - def relevant_line_numbers(metadata) - Metadata.ascend(metadata).map { |meta| meta[:line_number] } + locations[file_path].any? do |filter_line_num| + line_num == RSpec.world.preceding_declaration_line(file_path, filter_line_num) + end + end end - def example_group_declaration_lines(locations, metadata) - FlatMap.flat_map(Metadata.ascend(metadata)) do |meta| - locations[meta[:absolute_file_path]] - end.uniq + def proc_filter_applies?(key, proc, metadata) + case proc.arity + when 0 then proc.call + when 2 then proc.call(metadata[key], metadata) + else proc.call(metadata[key]) + end end def filters_apply?(key, value, metadata) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/metadata.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/metadata.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/metadata.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/metadata.rb 2016-02-18 22:33:38.000000000 +0000 @@ -47,7 +47,9 @@ return nil if line == '-e:1'.freeze line rescue SecurityError + # :nocov: nil + # :nocov: end # @private @@ -105,6 +107,11 @@ end # @private + def self.location_tuple_from(metadata) + [metadata[:absolute_file_path], metadata[:line_number]] + end + + # @private # Used internally to populate metadata hashes with computed keys # managed by RSpec. class HashPopulator @@ -147,12 +154,13 @@ end relative_file_path = Metadata.relative_path(file_path) + absolute_file_path = File.expand_path(relative_file_path) metadata[:file_path] = relative_file_path metadata[:line_number] = line_number.to_i metadata[:location] = "#{relative_file_path}:#{line_number}" - metadata[:absolute_file_path] = File.expand_path(relative_file_path) + metadata[:absolute_file_path] = absolute_file_path metadata[:rerun_file_path] ||= relative_file_path - metadata[:scoped_id] = build_scoped_id_for(relative_file_path) + metadata[:scoped_id] = build_scoped_id_for(absolute_file_path) end def file_path_and_line_number_from(backtrace) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/mutex.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/mutex.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/mutex.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/mutex.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -module RSpec - module Core - # On 1.8.7, it's in the stdlib. - # We don't want to load the stdlib, b/c this is a test tool, and can affect the test environment, - # causing tests to pass where they should fail. - # - # So we're transcribing/modifying it from https://github.com/ruby/ruby/blob/v1_8_7_374/lib/thread.rb#L56 - # Some methods we don't need are deleted. - # Anything I don't understand (there's quite a bit, actually) is left in. - # Some formating changes are made to appease the robot overlord: - # https://travis-ci.org/rspec/rspec-core/jobs/54410874 - # @private - class Mutex - def initialize - @waiting = [] - @locked = false - @waiting.taint - taint - end - - # @private - def lock - while Thread.critical = true && @locked - @waiting.push Thread.current - Thread.stop - end - @locked = true - Thread.critical = false - self - end - - # @private - def unlock - return unless @locked - Thread.critical = true - @locked = false - begin - t = @waiting.shift - t.wakeup if t - rescue ThreadError - retry - end - Thread.critical = false - begin - t.run if t - rescue ThreadError - :noop - end - self - end - - # @private - def synchronize - lock - begin - yield - ensure - unlock - end - end - end unless defined?(::RSpec::Core::Mutex) # Avoid warnings for library wide checks spec - end -end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/notifications.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/notifications.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/notifications.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/notifications.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,7 +1,6 @@ RSpec::Support.require_rspec_core "formatters/exception_presenter" RSpec::Support.require_rspec_core "formatters/helpers" RSpec::Support.require_rspec_core "shell_escape" -RSpec::Support.require_rspec_support "encoded_string" module RSpec::Core # Notifications are value objects passed to formatters to provide them @@ -10,6 +9,7 @@ # @private module NullColorizer module_function + def wrap(line, _code_or_symbol) line end @@ -281,7 +281,8 @@ # @attr pending_examples [Array] the pending examples # @attr load_time [Float] the number of seconds taken to boot RSpec # and load the spec files - SummaryNotification = Struct.new(:duration, :examples, :failed_examples, :pending_examples, :load_time) + SummaryNotification = Struct.new(:duration, :examples, :failed_examples, + :pending_examples, :load_time) class SummaryNotification # @api # @return [Fixnum] the number of examples run diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/option_parser.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/option_parser.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/option_parser.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/option_parser.rb 2016-02-18 22:33:38.000000000 +0000 @@ -34,6 +34,8 @@ private # rubocop:disable MethodLength + # rubocop:disable Metrics/AbcSize + # rubocop:disable CyclomaticComplexity def parser(options) OptionParser.new do |parser| parser.banner = "Usage: rspec [options] [files or directories]\n\n" @@ -69,7 +71,18 @@ bisect_and_exit(argument) end - parser.on('--[no-]fail-fast', 'Abort the run on first failure.') do |value| + parser.on('--[no-]fail-fast[=COUNT]', 'Abort the run after a certain number of failures (1 by default).') do |argument| + if argument == true + value = 1 + elsif argument == false || argument == 0 + value = false + else + begin + value = Integer(argument) + rescue ArgumentError + RSpec.warning "Expected an integer value for `--fail-fast`, got: #{argument.inspect}", :call_site => nil + end + end set_fail_fast(options, value) end @@ -174,12 +187,16 @@ parser.on("--next-failure", "Apply `--only-failures` and abort after one failure.", " (Equivalent to `--only-failures --fail-fast --order defined`)") do configure_only_failures(options) - set_fail_fast(options, true) + set_fail_fast(options, 1) options[:order] ||= 'defined' end parser.on('-P', '--pattern PATTERN', 'Load files matching pattern (default: "spec/**/*_spec.rb").') do |o| - options[:pattern] = o + if options[:pattern] + options[:pattern] += ',' + o + else + options[:pattern] = o + end end parser.on('--exclude-pattern PATTERN', @@ -246,10 +263,11 @@ raise OptionParser::InvalidOption.new end end - end end + # rubocop:enable Metrics/AbcSize # rubocop:enable MethodLength + # rubocop:enable CyclomaticComplexity def add_tag_filter(options, filter_type, tag_name, value=true) (options[filter_type] ||= {})[tag_name] = value diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/project_initializer/spec/spec_helper.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/project_initializer/spec/spec_helper.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/project_initializer/spec/spec_helper.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/project_initializer/spec/spec_helper.rb 2016-02-18 22:33:38.000000000 +0000 @@ -57,9 +57,9 @@ # Limits the available syntax to the non-monkey patched syntax that is # recommended. For more details, see: - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode config.disable_monkey_patching! # This setting enables warnings. It's recommended, but in some cases may diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/rake_task.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/rake_task.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/rake_task.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/rake_task.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,7 +1,16 @@ require 'rake' require 'rake/tasklib' -require 'rspec/support/ruby_features' -require 'rspec/core/shell_escape' +require 'rspec/support' + +RSpec::Support.require_rspec_support "ruby_features" + +# :nocov: +unless RSpec::Support.respond_to?(:require_rspec_core) + RSpec::Support.define_optimized_require_for_rspec(:core) { |f| require_relative "../#{f}" } +end +# :nocov: + +RSpec::Support.require_rspec_core "shell_escape" module RSpec module Core @@ -72,7 +81,7 @@ return unless fail_on_error $stderr.puts "#{command} failed" if verbose - exit $?.exitstatus + exit $?.exitstatus || 1 end private @@ -91,7 +100,7 @@ def file_inclusion_specification if ENV['SPEC'] - FileList[ ENV['SPEC']].sort + FileList[ENV['SPEC']].sort elsif String === pattern && !File.exist?(pattern) "--pattern #{escape pattern}" else diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/reentrant_mutex.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/reentrant_mutex.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/reentrant_mutex.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/reentrant_mutex.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -module RSpec - module Core - # Allows a thread to lock out other threads from a critical section of code, - # while allowing the thread with the lock to reenter that section. - # - # Based on Monitor as of 2.2 - https://github.com/ruby/ruby/blob/eb7ddaa3a47bf48045d26c72eb0f263a53524ebc/lib/monitor.rb#L9 - # - # Depends on Mutex, but Mutex is only available as part of core since 1.9.1: - # exists - http://ruby-doc.org/core-1.9.1/Mutex.html - # dne - http://ruby-doc.org/core-1.9.0/Mutex.html - # - # @private - class ReentrantMutex - def initialize - @owner = nil - @count = 0 - @mutex = Mutex.new - end - - def synchronize - enter - yield - ensure - exit - end - - private - - def enter - @mutex.lock if @owner != Thread.current - @owner = Thread.current - @count += 1 - end - - def exit - @count -= 1 - return unless @count == 0 - @owner = nil - @mutex.unlock - end - end - - if defined? ::Mutex - # On 1.9 and up, this is in core, so we just use the real one - Mutex = ::Mutex - else # For 1.8.7 - # :nocov: - RSpec::Support.require_rspec_core "mutex" - # :nocov: - end - end -end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/reporter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/reporter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/reporter.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/reporter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -8,7 +8,7 @@ :close, :deprecation, :deprecation_summary, :dump_failures, :dump_pending, :dump_profile, :dump_summary, :example_failed, :example_group_finished, :example_group_started, :example_passed, :example_pending, :example_started, - :message, :seed, :start, :start_dump, :stop + :message, :seed, :start, :start_dump, :stop, :example_finished ]) def initialize(configuration) @@ -125,6 +125,11 @@ end # @private + def example_finished(example) + notify :example_finished, Notifications::ExampleNotification.for(example) + end + + # @private def example_passed(example) notify :example_passed, Notifications::ExampleNotification.for(example) end @@ -192,6 +197,17 @@ exit!(exit_status) end + # @private + def fail_fast_limit_met? + return false unless (fail_fast = @configuration.fail_fast) + + if fail_fast == true + @failed_examples.any? + else + fail_fast <= @failed_examples.size + end + end + private def close @@ -201,7 +217,7 @@ def mute_profile_output? # Don't print out profiled info if there are failures and `--fail-fast` is # used, it just clutters the output. - !@configuration.profile_examples? || (@configuration.fail_fast? && @failed_examples.size > 0) + !@configuration.profile_examples? || fail_fast_limit_met? end def seed_used? diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/ruby_project.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/ruby_project.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/ruby_project.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/ruby_project.rb 2016-02-18 22:33:38.000000000 +0000 @@ -6,7 +6,7 @@ # @private module RubyProject def add_to_load_path(*dirs) - dirs.map { |dir| add_dir_to_load_path(File.join(root, dir)) } + dirs.each { |dir| add_dir_to_load_path(File.join(root, dir)) } end def add_dir_to_load_path(dir) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/runner.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/runner.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/runner.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/runner.rb 2016-02-18 22:33:38.000000000 +0000 @@ -2,6 +2,10 @@ module Core # Provides the main entry point to run a suite of RSpec examples. class Runner + # @attr_reader + # @private + attr_reader :options, :configuration, :world + # Register an `at_exit` hook that runs the suite when the process exits. # # @note This is not generally needed. The `rspec` command takes care @@ -65,13 +69,13 @@ require 'rspec/core/drb' begin DRbRunner.new(options).run(err, out) + return rescue DRb::DRbConnError err.puts "No DRb server is running. Running in local process instead ..." - new(options).run(err, out) end - else - new(options).run(err, out) end + + new(options).run(err, out) end def initialize(options, configuration=RSpec.configuration, world=RSpec.world) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/shared_example_group.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/shared_example_group.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/shared_example_group.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/shared_example_group.rb 2016-02-18 22:33:38.000000000 +0000 @@ -96,6 +96,7 @@ # Shared examples top level DSL. module TopLevelDSL # @private + # rubocop:disable Lint/NestedMethodDefinition def self.definitions proc do def shared_examples(name, *args, &block) @@ -105,6 +106,7 @@ alias shared_examples_for shared_examples end end + # rubocop:enable Lint/NestedMethodDefinition # @private def self.exposed_globally? diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/location.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/location.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/location.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/location.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,13 @@ +module RSpec + module Core + class Source + # @private + # Represents a source location of node or token. + Location = Struct.new(:line, :column) do + def self.location?(array) + array.is_a?(Array) && array.size == 2 && array.all? { |e| e.is_a?(Integer) } + end + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/node.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/node.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/node.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/node.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,93 @@ +RSpec::Support.require_rspec_core "source/location" + +module RSpec + module Core + class Source + # @private + # A wrapper for Ripper AST node which is generated with `Ripper.sexp`. + class Node + include Enumerable + + attr_reader :sexp, :parent + + def self.sexp?(array) + array.is_a?(Array) && array.first.is_a?(Symbol) + end + + def initialize(ripper_sexp, parent=nil) + @sexp = ripper_sexp.freeze + @parent = parent + end + + def type + sexp[0] + end + + def args + @args ||= raw_args.map do |raw_arg| + if Node.sexp?(raw_arg) + Node.new(raw_arg, self) + elsif Location.location?(raw_arg) + Location.new(*raw_arg) + elsif raw_arg.is_a?(Array) + GroupNode.new(raw_arg, self) + else + raw_arg + end + end.freeze + end + + def children + @children ||= args.select { |arg| arg.is_a?(Node) }.freeze + end + + def location + @location ||= args.find { |arg| arg.is_a?(Location) } + end + + def each(&block) + return to_enum(__method__) unless block_given? + + yield self + + children.each do |child| + child.each(&block) + end + end + + def each_ancestor + return to_enum(__method__) unless block_given? + + current_node = self + + while (current_node = current_node.parent) + yield current_node + end + end + + def inspect + "#<#{self.class} #{type}>" + end + + private + + def raw_args + sexp[1..-1] || [] + end + end + + # @private + class GroupNode < Node + def type + :group + end + + private + + def raw_args + sexp + end + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/syntax_highlighter.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/syntax_highlighter.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/syntax_highlighter.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/syntax_highlighter.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,71 @@ +module RSpec + module Core + class Source + # @private + # Provides terminal syntax highlighting of code snippets + # when coderay is available. + class SyntaxHighlighter + def initialize(configuration) + @configuration = configuration + end + + def highlight(lines) + implementation.highlight_syntax(lines) + end + + private + + if RSpec::Support::OS.windows? + # :nocov: + def implementation + WindowsImplementation + end + # :nocov: + else + def implementation + return color_enabled_implementation if @configuration.color_enabled? + NoSyntaxHighlightingImplementation + end + end + + def color_enabled_implementation + @color_enabled_implementation ||= begin + require 'coderay' + CodeRayImplementation + rescue LoadError + NoSyntaxHighlightingImplementation + end + end + + # @private + module CodeRayImplementation + RESET_CODE = "\e[0m" + + def self.highlight_syntax(lines) + highlighted = begin + CodeRay.encode(lines.join("\n"), :ruby, :terminal) + rescue Support::AllExceptionsExceptOnesWeMustNotRescue + return lines + end + + highlighted.split("\n").map do |line| + line.sub(/\S/) { |char| char.insert(0, RESET_CODE) } + end + end + end + + # @private + module NoSyntaxHighlightingImplementation + def self.highlight_syntax(lines) + lines + end + end + + # @private + # Not sure why, but our code above (and/or coderay itself) does not work + # on Windows, so we disable the feature on Windows. + WindowsImplementation = NoSyntaxHighlightingImplementation + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/token.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/token.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source/token.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source/token.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,86 @@ +RSpec::Support.require_rspec_core "source/location" + +module RSpec + module Core + class Source + # @private + # A wrapper for Ripper token which is generated with `Ripper.lex`. + class Token + CLOSING_TYPES_BY_OPENING_TYPE = { + :on_lbracket => :on_rbracket, + :on_lparen => :on_rparen, + :on_lbrace => :on_rbrace, + :on_heredoc_beg => :on_heredoc_end + }.freeze + + CLOSING_KEYWORDS_BY_OPENING_KEYWORD = { + 'do' => 'end' + }.freeze + + attr_reader :token + + def self.tokens_from_ripper_tokens(ripper_tokens) + ripper_tokens.map { |ripper_token| new(ripper_token) }.freeze + end + + def initialize(ripper_token) + @token = ripper_token.freeze + end + + def location + @location ||= Location.new(*token[0]) + end + + def type + token[1] + end + + def string + token[2] + end + + def ==(other) + token == other.token + end + + alias_method :eql?, :== + + def inspect + "#<#{self.class} #{type} #{string.inspect}>" + end + + def keyword? + type == :on_kw + end + + def opening? + opening_delimiter? || opening_keyword? + end + + def closed_by?(other) + closed_by_delimiter?(other) || closed_by_keyword?(other) + end + + private + + def opening_delimiter? + CLOSING_TYPES_BY_OPENING_TYPE.key?(type) + end + + def opening_keyword? + return false unless keyword? + CLOSING_KEYWORDS_BY_OPENING_KEYWORD.key?(string) + end + + def closed_by_delimiter?(other) + other.type == CLOSING_TYPES_BY_OPENING_TYPE[type] + end + + def closed_by_keyword?(other) + return false unless other.keyword? + other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string] + end + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/source.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/source.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,76 @@ +RSpec::Support.require_rspec_core 'source/node' +RSpec::Support.require_rspec_core 'source/syntax_highlighter' +RSpec::Support.require_rspec_core 'source/token' + +module RSpec + module Core + # @private + # Represents a Ruby source file and provides access to AST and tokens. + class Source + attr_reader :source, :path + + def self.from_file(path) + source = File.read(path) + new(source, path) + end + + def initialize(source_string, path=nil) + @source = source_string + @path = path ? File.expand_path(path) : '(string)' + end + + def lines + @lines ||= source.split("\n") + end + + def ast + @ast ||= begin + require 'ripper' + sexp = Ripper.sexp(source) + raise SyntaxError unless sexp + Node.new(sexp) + end + end + + def tokens + @tokens ||= begin + require 'ripper' + tokens = Ripper.lex(source) + Token.tokens_from_ripper_tokens(tokens) + end + end + + def nodes_by_line_number + @nodes_by_line_number ||= begin + nodes_by_line_number = ast.select(&:location).group_by { |node| node.location.line } + Hash.new { |hash, key| hash[key] = [] }.merge(nodes_by_line_number) + end + end + + def tokens_by_line_number + @tokens_by_line_number ||= begin + nodes_by_line_number = tokens.group_by { |token| token.location.line } + Hash.new { |hash, key| hash[key] = [] }.merge(nodes_by_line_number) + end + end + + def inspect + "#<#{self.class} #{path}>" + end + + # @private + class Cache + attr_reader :syntax_highlighter + + def initialize(configuration) + @sources_by_path = {} + @syntax_highlighter = SyntaxHighlighter.new(configuration) + end + + def source_from_file(path) + @sources_by_path[path] ||= Source.from_file(path) + end + end + end + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/version.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/version.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/version.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/version.rb 2016-02-18 22:33:38.000000000 +0000 @@ -3,7 +3,7 @@ # Version information for RSpec Core. module Version # Current version of RSpec Core, in semantic versioning format. - STRING = '3.3.2' + STRING = '3.4.3' end end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/world.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/world.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/lib/rspec/core/world.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/lib/rspec/core/world.rb 2016-02-18 22:33:38.000000000 +0000 @@ -40,12 +40,18 @@ @configuration.filter_manager end + # @private + def registered_example_group_files + @example_group_counts_by_spec_file.keys + end + # @api private # # Register an example group. def register(example_group) + @configuration.on_example_group_definition_callbacks.each { |block| block.call(example_group) } example_groups << example_group - @example_group_counts_by_spec_file[example_group.metadata[:file_path]] += 1 + @example_group_counts_by_spec_file[example_group.metadata[:absolute_file_path]] += 1 example_group end @@ -90,10 +96,12 @@ # @api private # # Find line number of previous declaration. - def preceding_declaration_line(filter_line) - declaration_line_numbers.sort.inject(nil) do |highest_prior_declaration_line, line| - line <= filter_line ? line : highest_prior_declaration_line + def preceding_declaration_line(absolute_file_name, filter_line) + line_numbers = descending_declaration_line_numbers_by_file.fetch(absolute_file_name) do + return nil end + + line_numbers.find { |num| num <= filter_line } end # @private @@ -101,6 +109,14 @@ @configuration.reporter end + # @private + def source_cache + @source_cache ||= begin + RSpec::Support.require_rspec_core "source" + Source::Cache.new(@configuration) + end + end + # @api private # # Notify reporter of filters. @@ -113,14 +129,14 @@ unless filter_manager.empty? if filter_announcements.length == 1 - reporter.message("Run options: #{filter_announcements[0]}") + report_filter_message("Run options: #{filter_announcements[0]}") else - reporter.message("Run options:\n #{filter_announcements.join("\n ")}") + report_filter_message("Run options:\n #{filter_announcements.join("\n ")}") end end if @configuration.run_all_when_everything_filtered? && example_count.zero? && !@configuration.only_failures? - reporter.message("#{everything_filtered_message}; ignoring #{inclusion_filter.description}") + report_filter_message("#{everything_filtered_message}; ignoring #{inclusion_filter.description}") filtered_examples.clear inclusion_filter.clear end @@ -129,13 +145,18 @@ example_groups.clear if filter_manager.empty? - reporter.message("No examples found.") + report_filter_message("No examples found.") elsif exclusion_filter.empty? || inclusion_filter.empty? - reporter.message(everything_filtered_message) + report_filter_message(everything_filtered_message) end end # @private + def report_filter_message(message) + reporter.message(message) unless @configuration.silence_filter_announcements? + end + + # @private def everything_filtered_message "\nAll examples were filtered out" end @@ -160,8 +181,22 @@ private - def declaration_line_numbers - @declaration_line_numbers ||= FlatMap.flat_map(example_groups, &:declaration_line_numbers) + def descending_declaration_line_numbers_by_file + @descending_declaration_line_numbers_by_file ||= begin + declaration_locations = FlatMap.flat_map(example_groups, &:declaration_locations) + hash_of_arrays = Hash.new { |h, k| h[k] = [] } + + # TODO: change `inject` to `each_with_object` when we drop 1.8.7 support. + line_nums_by_file = declaration_locations.inject(hash_of_arrays) do |hash, (file_name, line_number)| + hash[file_name] << line_number + hash + end + + line_nums_by_file.each_value do |list| + list.sort! + list.reverse! + end + end end def fail_if_config_and_cli_options_invalid diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/LICENSE.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/LICENSE.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/LICENSE.md 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/LICENSE.md 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,26 @@ +The MIT License (MIT) +===================== + +* Copyright © 2012 Chad Humphries, David Chelimsky, Myron Marston +* Copyright © 2009 Chad Humphries, David Chelimsky +* Copyright © 2006 David Chelimsky, The RSpec Development Team +* Copyright © 2005 Steven Baker + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/License.txt ruby-rspec-3.4.0c3e0m1s1/rspec-core/License.txt --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/License.txt 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/License.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Chad Humphries, David Chelimsky, Myron Marston -Copyright (c) 2009 Chad Humphries, David Chelimsky -Copyright (c) 2006 David Chelimsky, The RSpec Development Team -Copyright (c) 2005 Steven Baker - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/maintenance-branch ruby-rspec-3.4.0c3e0m1s1/rspec-core/maintenance-branch --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/maintenance-branch 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/maintenance-branch 2016-02-18 22:33:38.000000000 +0000 @@ -1 +1 @@ -3-3-maintenance +3-4-maintenance diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/README.md ruby-rspec-3.4.0c3e0m1s1/rspec-core/README.md --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/README.md 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/README.md 2016-02-18 22:33:38.000000000 +0000 @@ -19,6 +19,20 @@ end ``` +## Contributing + +Once you've set up the environment, you'll need to cd into the working +directory of whichever repo you want to work in. From there you can run the +specs and cucumber features, and make patches. + +NOTE: You do not need to use rspec-dev to work on a specific RSpec repo. You +can treat each RSpec repo as an independent project. + +* [Build details](BUILD_DETAIL.md) +* [Code of Conduct](CODE_OF_CONDUCT.md) +* [Detailed contributing guide](CONTRIBUTING.md) +* [Development setup guide](DEVELOPMENT.md) + ## Basic Structure RSpec uses the words "describe" and "it" so we can express concepts like a conversation: @@ -364,6 +378,7 @@ ## Also see -* [http://github.com/rspec/rspec](http://github.com/rspec/rspec) -* [http://github.com/rspec/rspec-expectations](http://github.com/rspec/rspec-expectations) -* [http://github.com/rspec/rspec-mocks](http://github.com/rspec/rspec-mocks) +* [https://github.com/rspec/rspec](https://github.com/rspec/rspec) +* [https://github.com/rspec/rspec-expectations](https://github.com/rspec/rspec-expectations) +* [https://github.com/rspec/rspec-mocks](https://github.com/rspec/rspec-mocks) +* [https://github.com/rspec/rspec-rails](https://github.com/rspec/rspec-rails) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/rspec-core.gemspec ruby-rspec-3.4.0c3e0m1s1/rspec-core/rspec-core.gemspec --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/rspec-core.gemspec 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/rspec-core.gemspec 2016-02-18 22:33:38.000000000 +0000 @@ -14,7 +14,7 @@ s.description = "BDD for Ruby. RSpec runner and example groups." s.files = `git ls-files -- lib/*`.split("\n") - s.files += %w[README.md License.txt Changelog.md .yardopts .document] + s.files += %w[README.md LICENSE.md Changelog.md .yardopts .document] s.test_files = [] s.bindir = 'exe' s.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) } @@ -42,7 +42,6 @@ s.add_development_dependency "minitest", "~> 5.3" s.add_development_dependency "aruba", "~> 0.6.2" # 0.7 is broken on ruby 1.8.7 - s.add_development_dependency "nokogiri", (RUBY_VERSION < '1.9.3' ? "1.5.2" : "~> 1.5") s.add_development_dependency "coderay", "~> 1.0.9" s.add_development_dependency "mocha", "~> 0.13.0" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/.rubocop_rspec_base.yml ruby-rspec-3.4.0c3e0m1s1/rspec-core/.rubocop_rspec_base.yml --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/.rubocop_rspec_base.yml 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/.rubocop_rspec_base.yml 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects @@ -101,9 +101,9 @@ RedundantReturn: AllowMultipleReturnValues: true -# We have to rescue Exception in the `raise_error` matcher for it to work properly. +# Exceptions should be rescued with `Support::AllExceptionsExceptOnesWeMustNotRescue` RescueException: - Enabled: false + Enabled: true # We haven't adopted the `fail` to signal exceptions vs `raise` for re-raises convention. SignalException: diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/.rubocop.yml ruby-rspec-3.4.0c3e0m1s1/rspec-core/.rubocop.yml --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/.rubocop.yml 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/.rubocop.yml 2016-02-18 22:33:38.000000000 +0000 @@ -6,13 +6,33 @@ - lib/rspec/core/backport_random.rb # This should go down over time. -ClassLength: +Metrics/ClassLength: Max: 330 +Encoding: + EnforcedStyle: when_needed + Exclude: + - lib/rspec/core/formatters/exception_presenter.rb + +# This should go down over time. +Metrics/AbcSize: + Max: 40 + # This should go down over time. -LineLength: +Metrics/LineLength: Max: 130 +# This should go down over time. +Metrics/MethodLength: + Max: 40 + +# This should go down over time. +Metrics/CyclomaticComplexity: + Max: 12 + +Metrics/PerceivedComplexity: + Max: 15 + Lint/HandleExceptions: Exclude: - lib/rspec/core/example.rb @@ -23,9 +43,37 @@ Lint/LiteralInInterpolation: Enabled: false -# This should go down over time. -MethodLength: - Max: 40 +Lint/NonLocalExitFromIterator: + Enabled: false + +# We don't care about single vs double qoutes. +Style/StringLiteralsInInterpolation: + Enabled: false + +Style/SymbolProc: + Enabled: false + +Style/SpaceAroundOperators: + MultiSpaceAllowedForOperators: + - '=' + - '||=' + - '===' + - '=>' + - '<<' + - '||' + +Style/AccessModifierIndentation: + Enabled: false + +Style/RegexpLiteral: + Enabled: false + +# This could change depending of the style used +Style/MultilineOperationIndentation: + Enabled: false + +Style/BarePercentLiterals: + Enabled: false # Exclude the default spec_helper to make it easier to uncomment out # default settings (for both users and the Cucumber suite). @@ -41,10 +89,6 @@ - lib/rspec/core/option_parser.rb - lib/rspec/core/reporter.rb -# This should go down over time. -Style/CyclomaticComplexity: - Max: 12 - Style/RaiseArgs: Exclude: - lib/rspec/core/configuration.rb diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/clone_all_rspec_repos ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/clone_all_rspec_repos --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/clone_all_rspec_repos 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/clone_all_rspec_repos 2016-02-18 22:33:38.000000000 +0000 @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/functions.sh ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/functions.sh --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/functions.sh 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/functions.sh 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -11,6 +11,12 @@ SPECS_HAVE_RUN_FILE=specs.out MAINTENANCE_BRANCH=`cat maintenance-branch` +# Don't allow rubygems to pollute what's loaded. Also, things boot faster +# without the extra load time of rubygems. Only works on MRI Ruby 1.9+ +if is_mri_192_plus; then + export RUBYOPT="--disable=gem" +fi + function clone_repo { if [ ! -d $1 ]; then # don't clone if the dir is already there travis_retry eval "git clone git://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH" @@ -46,10 +52,15 @@ # the bin/cucumber approach below. That approach is faster # (as it avoids the bundler tax), so we use it on rubies where we can. bundle exec cucumber --strict + elif is_jruby; then + # For some reason JRuby doesn't like our improved bundler setup + RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \ + PATH="${PWD}/bin:$PATH" \ + bin/cucumber --strict else # Prepare RUBYOPT for scenarios that are shelling out to ruby, # and PATH for those that are using `rspec` or `rake`. - RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \ + RUBYOPT="${RUBYOPT} -I${PWD}/../bundle -rbundler/setup" \ PATH="${PWD}/bin:$PATH" \ bin/cucumber --strict fi @@ -67,16 +78,74 @@ function run_spec_suite_for { if [ ! -f ../$1/$SPECS_HAVE_RUN_FILE ]; then # don't rerun specs that have already run - echo "Running specs for $1" - pushd ../$1 - unset BUNDLE_GEMFILE - bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` - travis_retry eval "bundle install $bundle_install_flags" - run_specs_and_record_done - popd + if [ -d ../$1 ]; then + echo "Running specs for $1" + pushd ../$1 + unset BUNDLE_GEMFILE + bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"` + if is_mri_192_plus; then + travis_retry eval "RUBYOPT=$RUBYOPT:'--enable rubygems' bundle install $bundle_install_flags" + else + travis_retry eval "bundle install $bundle_install_flags" + fi + run_specs_and_record_done + popd + else + echo "" + echo "WARNING: The ../$1 directory does not exist. Usually the" + echo "travis build cds into that directory and run the specs to" + echo "ensure the specs still pass with your latest changes, but" + echo "we are going to skip that step." + echo "" + fi; fi; } +function check_binstubs { + echo "Checking required binstubs" + + local success=0 + local binstubs="" + local gems="" + + if [ ! -x ./bin/rspec ]; then + binstubs="$binstubs bin/rspec" + gems="$gems rspec-core" + success=1 + fi + + if [ ! -x ./bin/rake ]; then + binstubs="$binstubs bin/rake" + gems="$gems rake" + success=1 + fi + + if [ -d features ]; then + if [ ! -x ./bin/cucumber ]; then + binstubs="$binstubs bin/cucumber" + gems="$gems cucumber" + success=1 + fi + fi + + if [ $success -eq 1 ]; then + echo + echo "Missing binstubs:$binstubs" + echo "Install missing binstubs using one of the following:" + echo + echo " # Create the missing binstubs" + echo " $ bundle binstubs$gems" + echo + echo " # To binstub all gems" + echo " $ bundle install --binstubs" + echo + echo " # To binstub all gems and avoid loading bundler" + echo " $ bundle install --binstubs --standalone" + fi + + return $success +} + function check_documentation_coverage { echo "bin/yard stats --list-undoc" @@ -119,7 +188,6 @@ } function run_all_spec_suites { - fold "one-by-one specs" run_specs_one_by_one fold "rspec-core specs" run_spec_suite_for "rspec-core" fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations" fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/predicate_functions.sh ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/predicate_functions.sh --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/predicate_functions.sh 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/predicate_functions.sh 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -11,12 +11,34 @@ fi; } +function is_jruby { + if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then + # RUBY_ENGINE only returns 'ruby' on MRI. + # MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode) + return 0 + else + return 1 + fi; +} + function is_mri_192 { if is_mri; then if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then return 0 else return 1 + fi + else + return 1 + fi +} + +function is_mri_192_plus { + if is_mri; then + if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then + return 0 + else + return 1 fi else return 1 diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/run_build ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/run_build --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/run_build 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/run_build 2016-02-18 22:33:38.000000000 +0000 @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -10,6 +10,8 @@ source script/custom_build_functions.sh fi +fold "binstub check" check_binstubs + fold "specs" run_specs_and_record_done fold "cukes" run_cukes @@ -22,6 +24,7 @@ fi if is_mri; then + fold "one-by-one specs" run_specs_one_by_one run_all_spec_suites else echo "Skipping the rest of the build on non-MRI rubies" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/travis_functions.sh ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/travis_functions.sh --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/script/travis_functions.sh 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/script/travis_functions.sh 2016-02-18 22:33:38.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated on 2015-05-05T17:56:25+10:00 from the rspec-dev repo. +# This file was generated on 2016-01-06T09:36:21-08:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: @@ -50,6 +50,8 @@ if [ -n "$TRAVIS" ]; then printf "travis_fold:start:%s\r\e[0m" "$name" travis_time_start + else + echo "============= Starting $name ===============" fi "$@" @@ -60,6 +62,8 @@ if [ "$status" -eq 0 ]; then if [ -n "$TRAVIS" ]; then printf "travis_fold:end:%s\r\e[0m" "$name" + else + echo "============= Ending $name ===============" fi else STATUS="$status" diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/integration/failed_line_detection_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/integration/failed_line_detection_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/integration/failed_line_detection_spec.rb 1970-01-01 00:00:00.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/integration/failed_line_detection_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -0,0 +1,158 @@ +require 'support/aruba_support' + +RSpec.describe 'Failed line detection' do + include_context "aruba support" + before { clean_current_dir } + + it "finds the source of a failure in a spec file that is defined at the current directory instead of in the normal `spec` subdir" do + write_file "the_spec.rb", " + RSpec.describe do + it 'fails via expect' do + expect(1).to eq(2) + end + end + " + + run_command "the_spec.rb" + expect(last_cmd_stdout).to include("expect(1).to eq(2)") + end + + it "finds the source of a failure in a spec file loaded by running `ruby file` rather than loaded directly by RSpec" do + write_file "passing_spec.rb", " + RSpec.describe do + example { } + end + " + + write_file "failing_spec.rb", " + RSpec.describe do + it 'fails via expect' do + expect(1).to eq(2) + end + end + " + + file = in_current_dir { "#{Dir.pwd}/failing_spec.rb" } + load file + run_command "passing_spec.rb" + + expect(last_cmd_stdout).to include("expect(1).to eq(2)") + end + + it "finds the direct source of failure in any lib, app or spec file, and allows the user to configure what is considered a project source dir" do + write_file "lib/lib_mod.rb", " + module LibMod + def self.trigger_failure + raise 'LibMod failure' + end + end + " + + write_file "app/app_mod.rb", " + module AppMod + def self.trigger_failure + raise 'AppMod failure' + end + end + " + + write_file "spec/support/spec_support.rb", " + module SpecSupport + def self.trigger_failure + raise 'SpecSupport failure' + end + end + " + + write_file "spec/default_config_spec.rb", " + require './lib/lib_mod' + require './spec/support/spec_support' + require './app/app_mod' + + RSpec.describe do + example('1') { LibMod.trigger_failure } + example('2') { AppMod.trigger_failure } + example('3') { SpecSupport.trigger_failure } + end + " + + run_command "./spec/default_config_spec.rb" + + expect(last_cmd_stdout).to include("raise 'LibMod failure'"). + and include("raise 'AppMod failure'"). + and include("raise 'SpecSupport failure'"). + and exclude("AppMod.trigger_failure") + + write_file "spec/change_config_spec.rb", " + require './app/app_mod' + + RSpec.configure do |c| + c.project_source_dirs = %w[ lib spec ] + end + + RSpec.describe do + example('1') { AppMod.trigger_failure } + end + " + + run_command "./spec/change_config_spec.rb" + + expect(last_cmd_stdout).to include("AppMod.trigger_failure"). + and exclude("raise 'AppMod failure'") + end + + it "finds the callsite of a method provided by a gem that fails (rather than the line in the gem)" do + write_file "vendor/gems/assertions/lib/assertions.rb", " + module Assertions + AssertionFailed = Class.new(StandardError) + + def assert(value, msg) + raise(AssertionFailed, msg) unless value + end + end + " + + write_file "spec/unit/the_spec.rb", " + require './vendor/gems/assertions/lib/assertions' + + RSpec.describe do + include Assertions + + it 'fails via assert' do + assert false, 'failed assertion' + end + + it 'fails via expect' do + expect(1).to eq(2) + end + end + " + + run_command "" + + expect(last_cmd_stdout).to include("assert false, 'failed assertion'"). + and include("expect(1).to eq(2)"). + and exclude("raise(AssertionFailed, msg)") + end + + it "falls back to finding a line in a gem when there are no backtrace lines in the app, lib or spec directories" do + write_file "vendor/gems/before_failure/lib/before_failure.rb", " + RSpec.configure do |c| + c.before { raise 'before failure!' } + end + " + + write_file "spec/unit/the_spec.rb", " + require './vendor/gems/before_failure/lib/before_failure' + + RSpec.describe do + example('1') { } + end + " + + run_command "" + + expect(last_cmd_stdout).to include("c.before { raise 'before failure!' }"). + and exclude("Unable to find matching line from backtrace") + end +end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/integration/filtering_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/integration/filtering_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/integration/filtering_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/integration/filtering_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -96,6 +96,33 @@ run_command "spec/a_spec.rb:13 -fd" # selecting :if => false example expect(last_cmd_stdout).to include("0 examples, 0 failures").and exclude("ex 1", "ex 2", "ex 3", "ex 4", "ex 5") end + + it 'works correctly when line numbers align with a shared example group line number from another file' do + write_file_formatted 'spec/support/shared_examples_with_matching_line.rb', " + # line 1 + # line 2 + # line 3 + RSpec.shared_examples_for 'shared examples' do # line 4 + it 'fails' do # line 5 + fail 'shared example' + end + end + " + + write_file_formatted 'spec/some_spec.rb', " + require File.expand_path('../support/shared_examples_with_matching_line', __FILE__) # line 1 + RSpec.describe 'A group' do # line 2 + it_behaves_like 'shared examples' # line 3 + # line 4 + it 'passes' do # line 5 + expect(1).to eq(1) + end + end + " + + run_command "spec/some_spec.rb:5" + expect(last_cmd_stdout).to include("1 example, 0 failures") + end end context "passing a line-number-filtered file and a non-filtered file" do diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/backtrace_formatter_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/backtrace_formatter_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/backtrace_formatter_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/backtrace_formatter_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -132,13 +132,23 @@ end end - describe "an empty backtrace" do + describe "for an empty backtrace" do it "does not add the explanatory message about backtrace filtering" do formatter = BacktraceFormatter.new expect(formatter.format_backtrace([])).to eq([]) end end + describe "for a `nil` backtrace (since exceptions can have no backtrace!)" do + it 'returns a blank array, with no explanatory message' do + exception = Exception.new + expect(exception.backtrace).to be_nil + + formatter = BacktraceFormatter.new + expect(formatter.format_backtrace(exception.backtrace)).to eq([]) + end + end + context "when rspec is installed in the current working directory" do it "excludes lines from rspec libs by default", :unless => RSpec::Support::OS.windows? do backtrace = [ diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/coordinator_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/coordinator_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/coordinator_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/coordinator_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -10,7 +10,7 @@ FakeBisectRunner.new( 1.upto(8).map { |i| "#{i}.rb[1:1]" }, %w[ 2.rb[1:1] ], - { "5.rb[1:1]" => "4.rb[1:1]" } + { "5.rb[1:1]" => %w[ 1.rb[1:1] 4.rb[1:1] ] } ) end @@ -34,14 +34,15 @@ |Bisect started using options: "" |Running suite to find failures... (n.nnnn seconds) |Starting bisect with 2 failing examples and 6 non-failing examples. + |Checking that failure(s) are order-dependent... failure appears to be order-dependent | - |Round 1: searching for 3 non-failing examples (of 6) to ignore: .. (n.nnnn seconds) - |Round 2: searching for 2 non-failing examples (of 3) to ignore: . (n.nnnn seconds) - |Round 3: searching for 1 non-failing example (of 1) to ignore: . (n.nnnn seconds) - |Bisect complete! Reduced necessary non-failing examples from 6 to 1 in n.nnnn seconds. + |Round 1: bisecting over non-failing examples 1-6 .. ignoring examples 4-6 (n.nnnn seconds) + |Round 2: bisecting over non-failing examples 1-3 .. multiple culprits detected - splitting candidates (n.nnnn seconds) + |Round 3: bisecting over non-failing examples 1-2 .. ignoring example 2 (n.nnnn seconds) + |Bisect complete! Reduced necessary non-failing examples from 6 to 2 in n.nnnn seconds. | |The minimal reproduction command is: - | rspec 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] + | rspec 1.rb[1:1] 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] EOS end @@ -63,8 +64,10 @@ | - 6.rb[1:1] | - 7.rb[1:1] | - 8.rb[1:1] - | - |Round 1: searching for 3 non-failing examples (of 6) to ignore: + |Checking that failure(s) are order-dependent.. + | - Running: rspec 2.rb[1:1] 5.rb[1:1] (n.nnnn seconds) + | - Failure appears to be order-dependent + |Round 1: bisecting over non-failing examples 1-6 | - Running: rspec 2.rb[1:1] 5.rb[1:1] 6.rb[1:1] 7.rb[1:1] 8.rb[1:1] (n.nnnn seconds) | - Running: rspec 1.rb[1:1] 2.rb[1:1] 3.rb[1:1] 4.rb[1:1] 5.rb[1:1] (n.nnnn seconds) | - Examples we can safely ignore (3): @@ -75,32 +78,82 @@ | - 1.rb[1:1] | - 3.rb[1:1] | - 4.rb[1:1] - | - Round finished (n.nnnn seconds) - |Round 2: searching for 2 non-failing examples (of 3) to ignore: + |Round 2: bisecting over non-failing examples 1-3 | - Running: rspec 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] (n.nnnn seconds) - | - Examples we can safely ignore (2): - | - 1.rb[1:1] + | - Running: rspec 1.rb[1:1] 2.rb[1:1] 3.rb[1:1] 5.rb[1:1] (n.nnnn seconds) + | - Multiple culprits detected - splitting candidates + |Round 3: bisecting over non-failing examples 1-2 + | - Running: rspec 2.rb[1:1] 3.rb[1:1] 4.rb[1:1] 5.rb[1:1] (n.nnnn seconds) + | - Running: rspec 1.rb[1:1] 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] (n.nnnn seconds) + | - Examples we can safely ignore (1): | - 3.rb[1:1] - | - Remaining non-failing examples (1): + | - Remaining non-failing examples (2): + | - 1.rb[1:1] | - 4.rb[1:1] - | - Round finished (n.nnnn seconds) - |Round 3: searching for 1 non-failing example (of 1) to ignore: - | - Running: rspec 2.rb[1:1] 5.rb[1:1] (n.nnnn seconds) - | - Round finished (n.nnnn seconds) - |Bisect complete! Reduced necessary non-failing examples from 6 to 1 in n.nnnn seconds. + |Bisect complete! Reduced necessary non-failing examples from 6 to 2 in n.nnnn seconds. | |The minimal reproduction command is: - | rspec 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] + | rspec 1.rb[1:1] 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] EOS end + context "with an order-independent failure" do + it "detects the independent case and prints the minimal reproduction" do + fake_runner.dependent_failures = {} + output = StringIO.new + find_minimal_repro(output) + output = normalize_durations(output.string) + + expect(output).to eq(<<-EOS.gsub(/^\s+\|/, '')) + |Bisect started using options: "" + |Running suite to find failures... (n.nnnn seconds) + |Starting bisect with 1 failing example and 7 non-failing examples. + |Checking that failure(s) are order-dependent... failure(s) do not require any non-failures to run first + | + |Bisect complete! Reduced necessary non-failing examples from 7 to 0 in n.nnnn seconds. + | + |The minimal reproduction command is: + | rspec 2.rb[1:1] + EOS + end + + it "can use the debug formatter for detailed output" do + fake_runner.dependent_failures = {} + output = StringIO.new + find_minimal_repro(output, Formatters::BisectDebugFormatter) + output = normalize_durations(output.string) + + expect(output).to eq(<<-EOS.gsub(/^\s+\|/, '')) + |Bisect started using options: "" + |Running suite to find failures... (n.nnnn seconds) + | - Failing examples (1): + | - 2.rb[1:1] + | - Non-failing examples (7): + | - 1.rb[1:1] + | - 3.rb[1:1] + | - 4.rb[1:1] + | - 5.rb[1:1] + | - 6.rb[1:1] + | - 7.rb[1:1] + | - 8.rb[1:1] + |Checking that failure(s) are order-dependent.. + | - Running: rspec 2.rb[1:1] (n.nnnn seconds) + | - Failure is not order-dependent + |Bisect complete! Reduced necessary non-failing examples from 7 to 0 in n.nnnn seconds. + | + |The minimal reproduction command is: + | rspec 2.rb[1:1] + EOS + end + end + context "when the user aborst the bisect with ctrl-c" do let(:aborting_formatter) do Class.new(Formatters::BisectProgressFormatter) do Formatters.register self - def bisect_round_finished(notification) - return super unless notification.round == 2 + def bisect_round_started(notification) + return super unless @round_count == 1 Process.kill("INT", Process.pid) # Process.kill is not a synchronous call, so to ensure the output @@ -128,14 +181,14 @@ |Bisect started using options: "" |Running suite to find failures... (n.nnnn seconds) |Starting bisect with 2 failing examples and 6 non-failing examples. + |Checking that failure(s) are order-dependent... failure appears to be order-dependent | - |Round 1: searching for 3 non-failing examples (of 6) to ignore: .. (n.nnnn seconds) - |Round 2: searching for 2 non-failing examples (of 3) to ignore: . + |Round 1: bisecting over non-failing examples 1-6 .. ignoring examples 4-6 (n.nnnn seconds) | |Bisect aborted! | |The most minimal reproduction command discovered so far is: - | rspec 2.rb[1:1] 4.rb[1:1] 5.rb[1:1] + | rspec 1.rb[1:1] 2.rb[1:1] 3.rb[1:1] 4.rb[1:1] 5.rb[1:1] EOS end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/example_minimizer_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/example_minimizer_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/example_minimizer_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/example_minimizer_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -9,7 +9,7 @@ FakeBisectRunner.new( %w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ], %w[ ex_2 ], - { "ex_5" => "ex_4" } + { "ex_5" => %w[ ex_4 ] } ) end @@ -19,6 +19,89 @@ expect(minimizer.repro_command_for_currently_needed_ids).to eq("rspec ex_2 ex_4 ex_5") end + it 'reduces a failure where none of the passing examples are implicated' do + no_dependents_runner = FakeBisectRunner.new( + %w[ ex_1 ex_2 ], + %w[ ex_2 ], + {} + ) + minimizer = Bisect::ExampleMinimizer.new(no_dependents_runner, RSpec::Core::NullReporter) + minimizer.find_minimal_repro + expect(minimizer.repro_command_for_currently_needed_ids).to eq("rspec ex_2") + end + + it 'reduces a failure when more than 50% of examples are implicated' do + fake_runner.always_failures = [] + fake_runner.dependent_failures = { "ex_8" => %w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ] } + minimizer = Bisect::ExampleMinimizer.new(fake_runner, RSpec::Core::NullReporter) + minimizer.find_minimal_repro + expect(minimizer.repro_command_for_currently_needed_ids).to eq( + "rspec ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_8" + ) + end + + it 'reduces a failure with multiple dependencies' do + fake_runner.always_failures = [] + fake_runner.dependent_failures = { "ex_8" => %w[ ex_1 ex_3 ex_5 ex_7 ] } + minimizer = Bisect::ExampleMinimizer.new(fake_runner, RSpec::Core::NullReporter) + minimizer.find_minimal_repro + expect(minimizer.repro_command_for_currently_needed_ids).to eq( + "rspec ex_1 ex_3 ex_5 ex_7 ex_8" + ) + end + + context 'with an unminimisable failure' do + class RunCountingReporter < RSpec::Core::NullReporter + attr_accessor :round_count + attr_accessor :example_count + def initialize + @round_count = 0 + end + + def publish(event, *args) + send(event, *args) if respond_to? event + end + + def bisect_individual_run_start(_notification) + self.round_count += 1 + end + end + + let(:counting_reporter) { RunCountingReporter.new } + let(:fake_runner) do + FakeBisectRunner.new( + %w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ex_9 ], + [], + "ex_9" => %w[ ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ] + ) + end + let(:counting_minimizer) do + Bisect::ExampleMinimizer.new(fake_runner, counting_reporter) + end + + it 'returns the full command if the failure can not be reduced' do + counting_minimizer.find_minimal_repro + + expect(counting_minimizer.repro_command_for_currently_needed_ids).to eq( + "rspec ex_1 ex_2 ex_3 ex_4 ex_5 ex_6 ex_7 ex_8 ex_9" + ) + end + + it 'detects an unminimisable failure in the minimum number of runs' do + counting_minimizer.find_minimal_repro + + # The recursive bisection strategy should take 1 + 2 + 4 + 8 = 15 runs + # to determine that a failure is fully dependent on 8 preceding + # examples: + # + # 1 run to determine that any of the candidates are culprits + # 2 runs to determine that each half contains a culprit + # 4 runs to determine that each quarter contains a culprit + # 8 runs to determine that each candidate is a culprit + expect(counting_reporter.round_count).to eq(15) + end + end + it 'ignores flapping examples that did not fail on the initial full run but fail on later runs' do def fake_runner.run(ids) super.tap do |results| diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/subset_enumerator_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/subset_enumerator_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/bisect/subset_enumerator_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/bisect/subset_enumerator_spec.rb 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -require 'rspec/core/bisect/subset_enumerator' - -module RSpec::Core - RSpec.describe Bisect::SubsetEnumerator do - def enum_for(ids) - Bisect::SubsetEnumerator.new(ids) - end - - it 'is enumerable' do - expect(enum_for([])).to be_an(Enumerable) - end - - it 'systematically enumerates each subset of the given size, starting off with disjoint sets' do - ids = %w[ 1 2 3 4 5 6 7 8 ] - enum = enum_for(ids) - combos = enum.to_a - expect(combos).to start_with([ - # start with each half... - %w[ 1 2 3 4 ], %w[ 5 6 7 8 ], - # then cut in 4ths and combine those in all the unseen combos... - %w[ 1 2 5 6 ], %w[ 1 2 7 8 ], - %w[ 3 4 5 6 ], %w[ 3 4 7 8 ], - # then cut in 8ths and do the same... - %w[ 1 2 3 5 ], %w[ 1 2 3 6 ], %w[ 1 2 3 7 ], %w[ 1 2 3 8 ], - %w[ 1 2 4 5 ], %w[ 1 2 4 6 ], %w[ 1 2 4 7 ], %w[ 1 2 4 8 ] - ]) - - # We don't care to specify the rest of the order, but we care that all combos were hit. - expect(combos).to match_array(ids.combination(4)) - end - - it 'works with a list size that is not a power of 2' do - ids = %w[ 1 2 3 4 5 6 7 ] - enum = enum_for(ids) - combos = enum.to_a - expect(combos).to start_with([ - %w[ 1 2 3 4 ], %w[ 5 6 7 ], - %w[ 1 2 5 6 ], %w[ 1 2 7 ], - %w[ 3 4 5 6 ], %w[ 3 4 7 ] - ]) - - # Would be better to do: expect(combos).to match_array(ids.combination(4)) - # ...but we include a few extra sets of 3 due to our algorithm. - expect(combos).to include(*ids.combination(4)) - end - end -end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/configuration_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/configuration_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/configuration_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/configuration_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -18,6 +18,30 @@ end end + describe '#on_example_group_definition' do + let(:configuration) do + tmp_config = RSpec::Core::Configuration.new + tmp_config.on_example_group_definition do |example_group| + example_group.examples.first.metadata[:new_key] = :new_value + end + tmp_config + end + let(:world) { RSpec::Core::World.new(configuration) } + + it 'successfully invokes the block' do + example_group = RSpec.describe("group") { it "example 1" do; end} + world.register(example_group) + example = world.example_groups.first.examples.first + expect(example.metadata[:new_key]).to eq(:new_value) + end + end + + describe "#fail_fast" do + it "defaults to `nil`" do + expect(RSpec::Core::Configuration.new.fail_fast).to be(nil) + end + end + describe '#deprecation_stream' do it 'defaults to standard error' do expect($rspec_core_without_stderr_monkey_patch.deprecation_stream).to eq STDERR @@ -164,15 +188,14 @@ shared_examples "a configurable framework adapter" do |m| it "yields a config object if the framework_module supports it" do - custom_config = Struct.new(:custom_setting).new mod = Module.new - allow(mod).to receive_messages(:configuration => custom_config) + def mod.configuration; @config ||= Struct.new(:custom_setting).new; end config.send m, mod do |mod_config| mod_config.custom_setting = true end - expect(custom_config.custom_setting).to be_truthy + expect(mod.configuration.custom_setting).to be_truthy end it "raises if framework module doesn't support configuration" do @@ -236,8 +259,7 @@ it 'raises an error since this setting must be applied before any groups are defined' do allow(RSpec.world).to receive(:example_groups).and_return([double.as_null_object]) - mocha = stub_const("RSpec::Core::MockingAdapters::Mocha", Module.new) - allow(mocha).to receive_messages(:framework_name => :mocha) + class_double("RSpec::Core::MockingAdapters::Mocha", :framework_name => :mocha).as_stubbed_const expect { config.mock_with :mocha @@ -251,8 +273,7 @@ end it 'does not raise an error if re-setting the same config' do - mocha = stub_const("RSpec::Core::MockingAdapters::Mocha", Module.new) - allow(mocha).to receive_messages(:framework_name => :mocha) + class_double("RSpec::Core::MockingAdapters::Mocha", :framework_name => :mocha).as_stubbed_const groups = [] allow(RSpec.world).to receive_messages(:example_groups => groups) @@ -796,6 +817,14 @@ end end + it "allows file names with brackets" do + assign_files_or_directories_to_run "./path/to/a_[1:2]spec.rb" + expect(config.files_to_run).to eq(["./path/to/a_[1:2]spec.rb"]) + + assign_files_or_directories_to_run "./path/to/a_spec.rb[foo]" + expect(config.files_to_run).to eq(["./path/to/a_spec.rb[foo]"]) + end + context "with an example id" do it "assigns the file and id as an ids filter" do assign_files_or_directories_to_run "./path/to/a_spec.rb[1:2]" @@ -851,6 +880,12 @@ it 'defaults to "spec"' do expect(config.default_path).to eq('spec') end + + it 'adds to the `project_source_dirs`' do + expect { + config.default_path = 'test' + }.to change { config.project_source_dirs.include?('test') }.from(false).to(true) + end end describe "#include" do @@ -1159,58 +1194,6 @@ end end - context "on windows" do - before do - @original_host = RbConfig::CONFIG['host_os'] - RbConfig::CONFIG['host_os'] = 'mingw' - allow(config).to receive(:require) - end - - after do - RbConfig::CONFIG['host_os'] = @original_host - end - - context "with ANSICON available" do - around(:each) { |e| with_env_vars('ANSICON' => 'ANSICON', &e) } - - it "enables colors" do - config.output_stream = StringIO.new - allow(config.output_stream).to receive_messages :tty? => true - config.color = true - expect(config.color).to be_truthy - end - - it "leaves output stream intact" do - config.output_stream = $stdout - allow(config).to receive(:require) do |what| - config.output_stream = 'foo' if what =~ /Win32/ - end - config.color = true - expect(config.output_stream).to eq($stdout) - end - end - - context "with ANSICON NOT available" do - around { |e| without_env_vars('ANSICON', &e) } - - before do - allow_warning - end - - it "warns to install ANSICON" do - allow(config).to receive(:require) { raise LoadError } - expect_warning_with_call_site(__FILE__, __LINE__ + 1, /You must use ANSICON/) - config.color = true - end - - it "sets color to false" do - allow(config).to receive(:require) { raise LoadError } - config.color = true - expect(config.color).to be_falsey - end - end - end - it "prefers incoming cli_args" do config.output_stream = StringIO.new allow(config.output_stream).to receive_messages :tty? => true @@ -2010,6 +1993,27 @@ end end + describe '#raise_on_warning=(value)' do + around do |example| + original_setting = RSpec::Support.warning_notifier + example.run + RSpec::Support.warning_notifier = original_setting + end + + it 'causes warnings to raise errors when true' do + config.raise_on_warning = true + expect { + RSpec.warning 'All hell breaks loose' + }.to raise_error a_string_including('WARNING: All hell breaks loose') + end + + it 'causes warnings to default to warning when false' do + config.raise_on_warning = false + expect_warning_with_call_site(__FILE__, __LINE__ + 1) + RSpec.warning 'doesnt raise' + end + end + describe "#raise_errors_for_deprecations!" do it 'causes deprecations to raise errors rather than printing to the deprecation stream' do config.deprecation_stream = stream = StringIO.new @@ -2174,6 +2178,17 @@ end end + describe '#max_displayed_failure_line_count' do + it 'defaults to 10' do + expect(config.max_displayed_failure_line_count).to eq 10 + end + + it 'is configurable' do + config.max_displayed_failure_line_count = 5 + expect(config.max_displayed_failure_line_count).to eq 5 + end + end + # assigns files_or_directories_to_run and triggers post-processing # via `files_to_run`. def assign_files_or_directories_to_run(*value) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_group_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_group_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_group_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_group_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -494,7 +494,6 @@ context "with no filters" do it "returns all" do group = RSpec.describe - allow(group).to receive(:world) { self.world } example = group.example("does something") expect(group.filtered_examples).to eq([example]) end @@ -506,7 +505,6 @@ filter_manager.include :awesome => false allow(self.world).to receive_messages(:filter_manager => filter_manager) group = RSpec.describe - allow(group).to receive(:world) { self.world } group.example("does something") expect(group.filtered_examples).to eq([]) end @@ -1235,8 +1233,7 @@ end describe "#run_examples" do - - let(:reporter) { double("reporter").as_null_object } + let(:reporter) { RSpec::Core::NullReporter } it "returns true if all examples pass" do group = RSpec.describe('group') do @@ -1344,34 +1341,89 @@ end describe "#run" do - let(:reporter) { double("reporter").as_null_object } + context "with `fail_fast` set to `nil`" do + before { RSpec.configuration.fail_fast = nil } + let(:group) { RSpec.describe } + let(:reporter) { Reporter.new(RSpec.configuration) } - context "with fail_fast? => true" do - let(:group) do - group = RSpec.describe - allow(group).to receive(:fail_fast?) { true } - group + it "does not run abort due to failures" do + examples_run = [] + group().example('example 1') { examples_run << self; fail } + group().example('example 2') { examples_run << self; fail } + group().example('example 3') { examples_run << self; fail } + + group().run(reporter) + + expect(examples_run.length).to eq(3) end + end + + context "with fail_fast enabled" do + before { RSpec.configuration.fail_fast = true } + let(:group) { RSpec.describe } + let(:reporter) { Reporter.new(RSpec.configuration) } it "does not run examples after the failed example" do examples_run = [] - self.group.example('example 1') { examples_run << self } - self.group.example('example 2') { examples_run << self; fail; } - self.group.example('example 3') { examples_run << self } + group().example('example 1') { examples_run << self } + group().example('example 2') { examples_run << self; fail; } + group().example('example 3') { examples_run << self } - self.group.run + group().run(reporter) expect(examples_run.length).to eq(2) end it "sets RSpec.world.wants_to_quit flag if encountering an exception in before(:all)" do - self.group.before(:all) { raise "error in before all" } - self.group.example("equality") { expect(1).to eq(2) } - expect(self.group.run).to be_falsey + group().before(:all) { raise "error in before all" } + group().example("equality") { expect(1).to eq(2) } + expect(group().run(reporter)).to be_falsey expect(RSpec.world.wants_to_quit).to be_truthy end end + context "with fail_fast set to 3" do + before { RSpec.configuration.fail_fast = 3 } + let(:group) { RSpec.describe } + let(:reporter) { Reporter.new(RSpec.configuration) } + + it "does not run examples after 3 failed examples" do + examples_run = [] + group().example('example 1') { examples_run << self } + group().example('example 2') { examples_run << self; fail; } + group().example('example 3') { examples_run << self; fail; } + group().example('example 4') { examples_run << self; fail; } + group().example('example 5') { examples_run << self } + + group().run(reporter) + + expect(examples_run.length).to eq(4) + end + + it "does not set RSpec.world.wants_to_quit flag if encountering an exception in before(:all) causing less than 3 failures" do + group().before(:all) { raise "error in before all" } + group().example("equality") { expect(1).to eq(2) } + group().example("equality") { expect(1).to eq(2) } + + expect(group().run(reporter)).to be false + + expect(RSpec.world.wants_to_quit).to be_falsey + end + + it "sets RSpec.world.wants_to_quit flag if encountering an exception in before(:all) causing at least 3 failures" do + group().before(:all) { raise "error in before all" } + group().example("equality") { expect(1).to eq(1) } + group().example("equality") { expect(1).to eq(1) } + group().example("equality") { expect(1).to eq(1) } + + expect(group().run(reporter)).to be false + + expect(RSpec.world.wants_to_quit).to be true + end + end + + let(:reporter) { double("reporter").as_null_object } + context "with RSpec.world.wants_to_quit=true" do let(:group) { RSpec.describe } @@ -1381,7 +1433,7 @@ it "returns without starting the group" do expect(reporter).not_to receive(:example_group_started) - self.group.run(reporter) + group().run(reporter) end end @@ -1777,5 +1829,43 @@ expect(inspect_output).to end_with("\"example at #{path}:#{line}\">") end end + + def group_ids group + ids = [] + ['descendant_filtered_examples', 'descendants', + 'parent_groups', 'declaration_locations', 'before_context_ivars'].each do |method| + ids << group.send(method).object_id + end + ids + end + + it 'allows adding examples' do + group = RSpec.describe('group') do + example('ex 1') { expect(1).to eq(1) } + end + + # ids should remain the same until we add/remove an example + original_ids = group_ids group + expect(original_ids).to eq(group_ids(group)) + + group.add_example group.examples.first + expect(group.examples.length).to eq(2) + expect(original_ids).to_not eq(group_ids(group)) + end + + it 'allows removing examples' do + group = RSpec.describe('group') do + example('ex 1') { expect(1).to eq(1) } + end + group.add_example group.examples.first + + # ids should remain the same until we add/remove an example + original_ids = group_ids group + expect(original_ids).to eq(group_ids(group)) + + group.remove_example group.examples.first + expect(group.examples.length).to eq(0) + expect(original_ids).to_not eq(group_ids(group)) + end end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -22,6 +22,16 @@ expect { ignoring_warnings { pp example_instance }}.to output(/RSpec::Core::Example/).to_stdout end + describe "human readable output" do + it 'prints a human readable description when inspected' do + expect(example_instance.inspect).to eq("#") + end + + it 'prints a human readable description for #to_s' do + expect(example_instance.to_s).to eq("#") + end + end + describe "#rerun_argument" do it "returns the location-based rerun argument" do allow(RSpec.configuration).to receive_messages(:loaded_spec_files => [__FILE__]) @@ -30,6 +40,36 @@ end end + describe '#duplicate_with' do + it 'successfully duplicates an example' do + example = example_group.example { raise 'first' } + example2 = example.duplicate_with({ :custom_key => :custom_value }) + + # ensure metadata is unique for each example + expect(example.metadata.object_id).to_not eq(example2.metadata.object_id) + expect(example.metadata[:custom_key]).to eq(nil) + expect(example2.metadata[:custom_key]).to eq(:custom_value) + + # cloned examples must have unique ids + expect(example.id).to_not eq(example2.id) + + # cloned examples must both refer to the same example group (not a clone) + expect(example.example_group.object_id).to eq(example2.example_group.object_id) + end + end + + it "captures example timing even for exceptions unhandled by RSpec" do + unhandled = RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue::AVOID_RESCUING.first + example = example_group.example { raise unhandled } + + begin + example_group.run + rescue unhandled + # no-op, prevent from bubbling up + end + expect(example.execution_result.finished_at).not_to be_nil + end + describe "#exception" do it "supplies the exception raised, if there is one" do example = example_group.example { raise "first" } diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_status_persister_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_status_persister_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/example_status_persister_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/example_status_persister_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -58,6 +58,36 @@ ) end + it 'prevents simultaneous access to the file' do + # This tests whether a certain race condition is prevented: + # - read 1 + # - read 2 + # - write 1 + # - write 2 - write 1 is lost + ex_1 = new_example("#{existing_spec_file}[1:1]", :status => :passed) + ex_2 = new_example("spec_1.rb[1:1]", :status => :failed) + + persister_1 = ExampleStatusPersister.new([ex_1], file.path) + persister_2 = ExampleStatusPersister.new([ex_2], file.path) + persister_2_thread = nil + + # dumped_statuses is called after the file is locked but + # before the output is written + allow(persister_1).to receive(:dump_statuses).and_wrap_original do |m, *args| + persister_2_thread = Thread.new { persister_2.persist } + m.call(*args) + end + persister_1.persist + persister_2_thread.join + + loaded = ExampleStatusPersister.load_from(file.path) + + expect(loaded).to contain_exactly( + a_hash_including(:example_id => ex_1.id, :status => "passed"), + a_hash_including(:example_id => ex_2.id, :status => "failed") + ) + end + it 'merges the example statuses with the existing records in the named file' do ex_1 = new_example("#{existing_spec_file}[1:1]", :status => :passed) ex_2 = new_example("spec_1.rb[1:1]", :status => :failed) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/documentation_formatter_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -6,7 +6,6 @@ before do send_notification :start, start_notification(2) - allow(formatter).to receive(:color_enabled?).and_return(false) end def execution_result(values) @@ -19,12 +18,14 @@ send_notification :example_failed, example_notification( double("example 1", :description => "first example", :full_description => "group first example", - :execution_result => execution_result(:status => :failed, :exception => Exception.new) + :execution_result => execution_result(:status => :failed, :exception => Exception.new), + :metadata => {} )) send_notification :example_failed, example_notification( double("example 2", :description => "second example", :full_description => "group second example", - :execution_result => execution_result(:status => :failed, :exception => Exception.new) + :execution_result => execution_result(:status => :failed, :exception => Exception.new), + :metadata => {} )) expect(formatter_output.string).to match(/first example \(FAILED - 1\)/m) diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/exception_presenter_spec.rb 2016-02-18 22:33:38.000000000 +0000 @@ -1,3 +1,4 @@ +# encoding: utf-8 require 'pathname' module RSpec::Core @@ -10,18 +11,28 @@ before do allow(example.execution_result).to receive(:exception) { exception } example.metadata[:absolute_file_path] = __FILE__ + allow(exception).to receive(:cause) if RSpec::Support::RubyFeatures.supports_exception_cause? end describe "#fully_formatted" do - line_num = __LINE__ + 2 + if RSpec::Support::OS.windows? + let(:encoding_check) { '' } + line_num = __LINE__ + 1 + # The failure happened here! + it 'should check that output is not mangled' + else + let(:encoding_check) { ' Handles encoding too! ЙЦ' } + line_num = __LINE__ + 1 + # The failure happened here! Handles encoding too! ЙЦ + end let(:exception) { instance_double(Exception, :message => "Boom\nBam", :backtrace => [ "#{__FILE__}:#{line_num}"]) } - # The failure happened here! it "formats the exception with all the normal details" do expect(presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 1) Example - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} @@ -32,7 +43,8 @@ expect(presenter.fully_formatted(100)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 100) Example - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} @@ -40,28 +52,30 @@ end it "allows the caller to specify additional indentation" do - presenter = Formatters::ExceptionPresenter.new(exception, example, :indentation => 4) + the_presenter = Formatters::ExceptionPresenter.new(exception, example, :indentation => 4) - expect(presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 1) Example - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} EOS end - it 'passes the indentation on to the `:detail_formatter` lambda so it can align things' do + it 'aligns lines' do detail_formatter = Proc.new { "Some Detail" } - presenter = Formatters::ExceptionPresenter.new(exception, example, :indentation => 4, + the_presenter = Formatters::ExceptionPresenter.new(exception, example, :indentation => 4, :detail_formatter => detail_formatter) - expect(presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 1) Example | Some Detail - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} @@ -69,14 +83,15 @@ end it 'allows the caller to omit the description' do - presenter = Formatters::ExceptionPresenter.new(exception, example, + the_presenter = Formatters::ExceptionPresenter.new(exception, example, :detail_formatter => Proc.new { "Detail!" }, - :description_formatter => Proc.new { }) + :description => nil) - expect(presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 1) Detail! - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} @@ -84,11 +99,12 @@ end it 'allows the failure/error line to be used as the description' do - presenter = Formatters::ExceptionPresenter.new(exception, example, :description_formatter => lambda { |p| p.failure_slash_error_line }) + the_presenter = Formatters::ExceptionPresenter.new(exception, example, :description => nil) - expect(presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Failure/Error: # The failure happened here!#{ encoding_check } | - | 1) Failure/Error: # The failure happened here! | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} @@ -96,27 +112,337 @@ end it 'allows a caller to specify extra details that are added to the bottom' do - presenter = Formatters::ExceptionPresenter.new( - exception, example, :extra_detail_formatter => lambda do |failure_number, colorizer, indentation| - "#{indentation}extra detail for failure: #{failure_number}\n" + the_presenter = Formatters::ExceptionPresenter.new( + exception, example, :extra_detail_formatter => lambda do |failure_number, colorizer| + "extra detail for failure: #{failure_number}" end ) - expect(presenter.fully_formatted(2)).to eq(<<-EOS.gsub(/^ +\|/, '')) + expect(the_presenter.fully_formatted(2)).to eq(<<-EOS.gsub(/^ +\|/, '')) | | 2) Example - | Failure/Error: # The failure happened here! + | Failure/Error: # The failure happened here!#{ encoding_check } + | | Boom | Bam | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} | extra detail for failure: 2 EOS end + + let(:the_exception) { instance_double(Exception, :cause => second_exception, :message => "Boom\nBam", :backtrace => [ "#{__FILE__}:#{line_num}"]) } + + let(:second_exception) do + instance_double(Exception, :cause => first_exception, :message => "Second\nexception", :backtrace => ["#{__FILE__}:#{__LINE__}"]) + end + + let(:first_exception) do + instance_double(Exception, :cause => nil, :message => "Real\nculprit", :backtrace => ["#{__FILE__}:#{__LINE__}"]) + end + + it 'includes the first exception that caused the failure', :if => RSpec::Support::RubyFeatures.supports_exception_cause? do + the_presenter = Formatters::ExceptionPresenter.new(the_exception, example) + + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Example + | Failure/Error: # The failure happened here!#{ encoding_check } + | + | Boom + | Bam + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + | # ------------------ + | # --- Caused by: --- + | # Real + | # culprit + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:140 + EOS + end + + it 'wont produce a stack error when cause is the exception itself', :if => RSpec::Support::RubyFeatures.supports_exception_cause? do + allow(the_exception).to receive(:cause) { the_exception } + the_presenter = Formatters::ExceptionPresenter.new(the_exception, example) + + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Example + | Failure/Error: # The failure happened here!#{ encoding_check } + | + | Boom + | Bam + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + | # ------------------ + | # --- Caused by: --- + | # Boom + | # Bam + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + EOS + end + + it 'wont produce a stack error when the cause is an older exception', :if => RSpec::Support::RubyFeatures.supports_exception_cause? do + allow(the_exception).to receive(:cause) do + instance_double(Exception, :cause => the_exception, :message => "A loop", :backtrace => the_exception.backtrace) + end + the_presenter = Formatters::ExceptionPresenter.new(the_exception, example) + + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Example + | Failure/Error: # The failure happened here!#{ encoding_check } + | + | Boom + | Bam + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + | # ------------------ + | # --- Caused by: --- + | # A loop + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + EOS + end + + it "adds extra failure lines from the example metadata" do + extra_example = example.clone + failure_line = 'http://www.example.com/job_details/123' + extra_example.metadata[:extra_failure_lines] = [failure_line] + the_presenter = Formatters::ExceptionPresenter.new(exception, extra_example, :indentation => 4) + expect(the_presenter.fully_formatted(1)).to eq(<<-EOS.gsub(/^ +\|/, '')) + | + | 1) Example + | Failure/Error: # The failure happened here!#{ encoding_check } + | + | Boom + | Bam + | + | #{failure_line} + | + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{line_num} + EOS + end + + describe 'line format' do + let(:exception) do + begin + expression + rescue RSpec::Support::AllExceptionsExceptOnesWeMustNotRescue => exception + exception + end + end + + describe "syntax highlighting" do + let(:expression) do + expect('RSpec').to be_a(Integer) + end + + it 'uses our syntax highlighter on the code snippet to format it nicely' do + syntax_highlighter = instance_double(Source::SyntaxHighlighter) + allow(syntax_highlighter).to receive(:highlight) do |lines| + lines.map { |l| "#{l.strip}" } + end + + allow(RSpec.world.source_cache).to receive_messages(:syntax_highlighter => syntax_highlighter) + + formatted = presenter.fully_formatted(1) + expect(formatted).to include("expect('RSpec').to be_a(Integer)") + end + end + + context 'with single line expression and single line RSpec exception message' do + let(:expression) do + expect('RSpec').to be_a(Integer) + end + + it 'crams them without blank line' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: expect('RSpec').to be_a(Integer) + | expected "RSpec" to be a kind of Integer + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with multiline expression and single line RSpec exception message', :if => RSpec::Support::RubyFeatures.ripper_supported? do + let(:expression) do + expect('RSpec'). + to be_a(Integer) + end + + it 'inserts a blank line between the expression and the message' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: + | expect('RSpec'). + | to be_a(Integer) + | + | expected "RSpec" to be a kind of Integer + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with single line expression and multiline RSpec exception message' do + let(:expression) do + expect('RSpec').to be_falsey + end + + it 'inserts a blank line between the expression and the message' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: expect('RSpec').to be_falsey + | + | expected: falsey value + | got: "RSpec" + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with multiline expression and multiline RSpec exception message', :if => RSpec::Support::RubyFeatures.ripper_supported? do + let(:expression) do + expect('RSpec'). + to be_falsey + end + + it 'inserts a blank line between the expression and the message' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: + | expect('RSpec'). + | to be_falsey + | + | expected: falsey value + | got: "RSpec" + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with single line expression and RSpec exception message starting with linefeed (like `eq` matcher)' do + let(:expression) do + expect('Rspec').to eq('RSpec') + end + + it 'does not insert a superfluous blank line' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: expect('Rspec').to eq('RSpec') + | + | expected: "RSpec" + | got: "Rspec" + | + | (compared using ==) + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with multiline expression and RSpec exception message starting with linefeed (like `eq` matcher)', :if => RSpec::Support::RubyFeatures.ripper_supported? do + let(:expression) do + expect('Rspec'). + to eq('RSpec') + end + + it 'does not insert a superfluous blank line' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: + | expect('Rspec'). + | to eq('RSpec') + | + | expected: "RSpec" + | got: "Rspec" + | + | (compared using ==) + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with single line expression and single line non-RSpec exception message' do + let(:expression) do + expect { fail 'Something is wrong!' }.to change { RSpec } + end + + it 'inserts a blank line between the expression and the message' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: expect { fail 'Something is wrong!' }.to change { RSpec } + | + | RuntimeError: + | Something is wrong! + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + + context 'with multiline expression and single line non-RSpec exception message', :if => RSpec::Support::RubyFeatures.ripper_supported? do + let(:expression) do + expect { fail 'Something is wrong!' }. + to change { RSpec } + end + + it 'inserts a blank line between the expression and the message' do + expect(presenter.fully_formatted(1)).to start_with(<<-EOS.gsub(/^ +\|/, '').chomp) + | + | 1) Example + | Failure/Error: + | expect { fail 'Something is wrong!' }. + | to change { RSpec } + | + | RuntimeError: + | Something is wrong! + | # ./spec/rspec/core/formatters/exception_presenter_spec.rb: + EOS + end + end + end end - describe "#read_failed_line" do - def read_failed_line - presenter.send(:read_failed_line) + describe "#read_failed_lines" do + def read_failed_lines + presenter.send(:read_failed_lines) + end + + context 'when the failed expression spans multiple lines', :if => RSpec::Support::RubyFeatures.ripper_supported? do + let(:exception) do + begin + expect('RSpec').to be_a(String). + and start_with('R'). + and end_with('z') + rescue RSpec::Expectations::ExpectationNotMetError => exception + exception + end + end + + context 'and the line count does not exceed RSpec.configuration.max_displayed_failure_line_count' do + it 'returns all the lines' do + expect(read_failed_lines).to eq([ + " expect('RSpec').to be_a(String).", + " and start_with('R').", + " and end_with('z')" + ]) + end + end + + context 'and the line count exceeds RSpec.configuration.max_displayed_failure_line_count' do + before do + RSpec.configuration.max_displayed_failure_line_count = 2 + end + + it 'returns the lines without exceeding the max count' do + expect(read_failed_lines).to eq([ + " expect('RSpec').to be_a(String).", + " and start_with('R')." + ]) + end + end end context "when backtrace is a heterogeneous language stack trace" do @@ -130,7 +456,7 @@ end it "is handled gracefully" do - expect { read_failed_line }.not_to raise_error + expect { read_failed_lines }.not_to raise_error end end @@ -138,9 +464,9 @@ let(:exception) { instance_double(Exception, :backtrace => [ "#{__FILE__}:#{__LINE__}"]) } it "is handled gracefully" do - with_safe_set_to_level_that_triggers_security_errors do - expect { read_failed_line }.not_to raise_error - end + expect { + with_safe_set_to_level_that_triggers_security_errors { read_failed_lines } + }.not_to raise_error end end @@ -148,7 +474,7 @@ let(:exception) { instance_double(Exception, :backtrace => [ "#{__FILE__}:10000000"]) } it "reports the filename and that it was unable to find the matching line" do - expect(read_failed_line).to include("Unable to find matching line") + expect(read_failed_lines.first).to include("Unable to find matching line") end end @@ -158,7 +484,7 @@ it "reports the filename and that it was unable to find the matching line" do example.metadata[:absolute_file_path] = file - expect(read_failed_line).to include("Unable to find #{file} to read failed line") + expect(read_failed_lines.first).to include("Unable to find #{file} to read failed line") end end @@ -168,7 +494,7 @@ let(:exception) { instance_double(Exception, :backtrace => ["#{relative_file}:#{line}"]) } it 'still finds the backtrace line' do - expect(read_failed_line).to include("line = __LINE__") + expect(read_failed_lines.first).to include("line = __LINE__") end end @@ -188,7 +514,7 @@ let(:exception) { instance_double(Exception, :backtrace => [ "#{__FILE__}:#{__LINE__}"]) } it "doesn't hang when file exists" do - expect(read_failed_line.strip).to eql( + expect(read_failed_lines.first.strip).to eql( %Q[let(:exception) { instance_double(Exception, :backtrace => [ "\#{__FILE__}:\#{__LINE__}"]) }]) end end diff -Nru ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/html_formatted.html ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/html_formatted.html --- ruby-rspec-3.3.0c2e1m2s0/rspec-core/spec/rspec/core/formatters/html_formatted.html 2015-07-15 17:05:48.000000000 +0000 +++ ruby-rspec-3.4.0c3e0m1s1/rspec-core/spec/rspec/core/formatters/html_formatted.html 2016-02-18 22:33:38.000000000 +0000 @@ -1,10 +1,11 @@ - + + -RSpec results - - - - -