[DRE-commits] [ruby-rspec] 12/18: fix encoding for rspec-core, disable no warning check

Cédric Boutillier boutil at moszumanska.debian.org
Wed Mar 2 17:58:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-rspec.

commit 9d2da9c58d1034ef9624665821bc26e6875c0fb8
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Mar 2 18:30:25 2016 +0100

    fix encoding for rspec-core, disable no warning check
---
 .../disable_no_warning_spec_rspec-support.patch    |   3 +-
 debian/patches/fix_encoding.patch                  | 127 +++++++++++++++++++++
 2 files changed, 129 insertions(+), 1 deletion(-)

diff --git a/debian/patches/disable_no_warning_spec_rspec-support.patch b/debian/patches/disable_no_warning_spec_rspec-support.patch
index db14eb6..b64df9a 100644
--- a/debian/patches/disable_no_warning_spec_rspec-support.patch
+++ b/debian/patches/disable_no_warning_spec_rspec-support.patch
@@ -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 <boutil at debian.org>
 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 --git a/debian/patches/fix_encoding.patch b/debian/patches/fix_encoding.patch
index 3ffb3b6..5032234 100644
--- a/debian/patches/fix_encoding.patch
+++ b/debian/patches/fix_encoding.patch
@@ -19,3 +19,130 @@ Last-Update: 2015-06-13
  
  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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rspec.git



More information about the Pkg-ruby-extras-commits mailing list