Hi Cedric, Samuel, I really would like to have the latest version of ruby-progressbar in unstable (to have wpscan in Debian)
Le 11/06/2018 à 23:34, Cédric Boutillier a écrit : > On Mon, Jun 11, 2018 at 06:36:55AM +0200, Cédric Boutillier wrote: > > I haven't uploaded the new ruby-progressbar for now. > It builds fine now, but ruby-fuubar tests fail now with that version. > I could not figure out why. Do you want to investigate this? I found this upstream commit: https://github.com/thekompanee/fuubar/commit/7073852a3ce420fee9b9e3e772a683189958b9d7 As it didn't apply exactly, I tried to modify it and to build with the latest ruby-progressbar. It builds fine with the enclosed patch. I hope it can help. Regards, Sophie
Subject: [PATCH] Fix failing tests --- debian/control | 8 +-- debian/patches/fix-tests.patch | 95 ++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 debian/patches/fix-tests.patch diff --git a/debian/control b/debian/control index e417d45..d4c4548 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Debian Ruby Extras Maintainers <[email protected] Uploaders: Pirate Praveen <[email protected]> Build-Depends: debhelper (>= 9~), gem2deb, - ruby-progressbar (>= 1.4), - ruby-rspec (>= 3.0) + ruby-progressbar (>= 1.9), + ruby-rspec (>= 3.5) Standards-Version: 3.9.7 Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-fuubar.git Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-fuubar.git @@ -18,8 +18,8 @@ Package: ruby-fuubar Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ruby | ruby-interpreter, - ruby-progressbar (>= 1.4), - ruby-rspec (>= 3.0), + ruby-progressbar (>= 1.9), + ruby-rspec (>= 3.5), ${misc:Depends}, ${shlibs:Depends} Description: instafailing RSpec progress bar formatter diff --git a/debian/patches/fix-tests.patch b/debian/patches/fix-tests.patch new file mode 100644 index 0000000..a2081a6 --- /dev/null +++ b/debian/patches/fix-tests.patch @@ -0,0 +1,95 @@ +Origin: https://github.com/thekompanee/fuubar/commit/7073852a3ce420fee9b9e3e772a683189958b9d7 + +--- a/spec/fuubar_spec.rb ++++ b/spec/fuubar_spec.rb +@@ -75,7 +77,7 @@ describe Fuubar do + end + + it 'sets the format of the bar to the default' do +- expect(formatter.progress.instance_variable_get(:@format_string)).to eql ' %c/%C |%w>%i| %e ' ++ expect(formatter.progress.instance_variable_get(:@format)).to eql ' %c/%C |%w>%i| %e ' + end + + it 'sets the total to the number of examples' do +@@ -83,19 +85,19 @@ describe Fuubar do + end + + it 'sets the bar\'s output' do +- expect(formatter.progress.send(:output)).to eql formatter.output +- expect(formatter.progress.send(:output)).to eql output ++ expect(formatter.progress.send(:output).stream).to eql formatter.output ++ expect(formatter.progress.send(:output).stream).to eql output + end + + context 'and continuous integration is enabled' do + before do +- RSpec.configuration.fuubar_progress_bar_options = {:length => 40} ++ RSpec.configuration.fuubar_progress_bar_options = { :length => 40 } + ENV['CONTINUOUS_INTEGRATION'] = 'true' + end + + it 'throttles the progress bar at one second' do +- throttle = formatter.progress.instance_variable_get(:@throttle) +- throttle_rate = throttle.instance_variable_get(:@period) ++ throttle = formatter.progress.__send__(:output).__send__(:throttle) ++ throttle_rate = throttle.__send__(:rate) + + expect(throttle_rate).to eql 1.0 + end +@@ -104,8 +106,8 @@ describe Fuubar do + before do + formatter.start(start_notification) + +- throttle = formatter.progress.instance_variable_get(:@throttle) +- throttle_rate = throttle.instance_variable_set(:@period, 0.0) ++ throttle = formatter.progress.__send__(:output).__send__(:throttle) ++ throttle_rate = throttle.__send__(:rate=, 0.0) + + output.rewind + +@@ -120,13 +122,13 @@ describe Fuubar do + + context 'and continuous integration is not enabled' do + before do +- RSpec.configuration.fuubar_progress_bar_options = {:length => 40} ++ RSpec.configuration.fuubar_progress_bar_options = { :length => 40 } + ENV['CONTINUOUS_INTEGRATION'] = 'false' + end + + it 'throttles the progress bar at the default rate' do +- throttle = formatter.progress.instance_variable_get(:@throttle) +- throttle_rate = throttle.instance_variable_get(:@period) ++ throttle = formatter.progress.__send__(:output).__send__(:throttle) ++ throttle_rate = throttle.__send__(:rate) + + expect(throttle_rate).to eql 0.01 + end +@@ -135,8 +137,8 @@ describe Fuubar do + before do + formatter.start(start_notification) + +- throttle = formatter.progress.instance_variable_get(:@throttle) +- throttle_rate = throttle.instance_variable_set(:@period, 0.0) ++ throttle = formatter.progress.__send__(:output).__send__(:throttle) ++ throttle_rate = throttle.__send__(:rate=, 0.0) + + output.rewind + +@@ -164,7 +166,7 @@ describe Fuubar do + before(:each) { formatter.start(start_notification) } + + it 'properly creates the bar' do +- expect(formatter.progress.instance_variable_get(:@format_string)).to eql '%c' ++ expect(formatter.progress.instance_variable_get(:@format)).to eql '%c' + end + end + end +@@ -178,7 +180,7 @@ describe Fuubar do + + context 'and no custom options are passed in' do + it 'sets the format of the bar to the default' do +- expect(formatter.progress.instance_variable_get(:@format_string)).to eql ' %c/%C |%w>%i| %e ' ++ expect(formatter.progress.instance_variable_get(:@format)).to eql ' %c/%C |%w>%i| %e ' + end + end + diff --git a/debian/patches/series b/debian/patches/series index f5f6c8a..96e2982 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-Use-color-output-in-tests.patch +fix-tests.patch -- 2.19.0

