[DRE-commits] [ruby-aruba] 01/02: Add patch for removed Utils class usage (Closes: 836735).

Hleb Valoshka tsfgnu-guest at moszumanska.debian.org
Mon Sep 5 10:49:00 UTC 2016


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

tsfgnu-guest pushed a commit to branch debian/sid
in repository ruby-aruba.

commit 65515fa85e4aa43cca3cd4211308cbea94c949ff
Author: Hleb Valoshka <375gnu at gmail.com>
Date:   Mon Sep 5 13:37:18 2016 +0300

    Add patch for removed Utils class usage (Closes: 836735).
---
 ...5-avoid-using-removed-Utils-class-fix-346.patch | 133 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 134 insertions(+)

diff --git a/debian/patches/0005-avoid-using-removed-Utils-class-fix-346.patch b/debian/patches/0005-avoid-using-removed-Utils-class-fix-346.patch
new file mode 100644
index 0000000..371851f
--- /dev/null
+++ b/debian/patches/0005-avoid-using-removed-Utils-class-fix-346.patch
@@ -0,0 +1,133 @@
+From: Cezary Baginski <cezary at chronomantic.net>
+Date: Mon, 5 Sep 2016 13:33:57 +0300
+Subject: avoid using removed Utils class [fix #346]
+
+---
+ lib/aruba/platforms/command_monitor.rb       |  6 ++--
+ spec/aruba/api/deprecated_spec.rb            | 41 ++++++++++++++++++++++++++++
+ spec/aruba/platforms/command_monitor_spec.rb | 37 +++++++++++++++++++++++++
+ 3 files changed, 81 insertions(+), 3 deletions(-)
+ create mode 100644 spec/aruba/api/deprecated_spec.rb
+ create mode 100644 spec/aruba/platforms/command_monitor_spec.rb
+
+diff --git a/lib/aruba/platforms/command_monitor.rb b/lib/aruba/platforms/command_monitor.rb
+index 644972b..087d99d 100644
+--- a/lib/aruba/platforms/command_monitor.rb
++++ b/lib/aruba/platforms/command_monitor.rb
+@@ -102,7 +102,7 @@ module Aruba
+     # @param [String] cmd
+     #   The command
+     def output_from(cmd)
+-      cmd = Utils.detect_ruby(cmd)
++      cmd = Aruba.platform.detect_ruby(cmd)
+       find(cmd).output
+     end
+ 
+@@ -112,7 +112,7 @@ module Aruba
+     # @param [String] cmd
+     #   The command
+     def stdout_from(cmd)
+-      cmd = Utils.detect_ruby(cmd)
++      cmd = Aruba.platform.detect_ruby(cmd)
+       find(cmd).stdout
+     end
+ 
+@@ -122,7 +122,7 @@ module Aruba
+     # @param [String] cmd
+     #   The command
+     def stderr_from(cmd)
+-      cmd = Utils.detect_ruby(cmd)
++      cmd = Aruba.platform.detect_ruby(cmd)
+       find(cmd).stderr
+     end
+ 
+diff --git a/spec/aruba/api/deprecated_spec.rb b/spec/aruba/api/deprecated_spec.rb
+new file mode 100644
+index 0000000..668692a
+--- /dev/null
++++ b/spec/aruba/api/deprecated_spec.rb
+@@ -0,0 +1,41 @@
++require 'spec_helper'
++
++if Aruba::VERSION <= '1.0.0'
++  RSpec.describe 'Deprecated API' do
++    include_context 'uses aruba API'
++
++    around do |example|
++      Aruba.platform.with_environment do
++        example.run
++      end
++    end
++
++    let(:monitor) { instance_double(Aruba::CommandMonitor) }
++
++    before do
++      allow(@aruba.aruba).to receive(:command_monitor).and_return(monitor)
++      allow(Aruba.platform).to receive(:deprecated)
++    end
++
++    describe "#output_from" do
++      it "works" do
++        allow(monitor).to receive(:stdout_from).with('foobar').and_return("foo")
++        expect(@aruba.stdout_from('foobar')).to eq('foo')
++      end
++    end
++
++    describe "#stdout_from" do
++      it "works" do
++        allow(monitor).to receive(:stdout_from).with('foobar').and_return("foo")
++        expect(@aruba.stdout_from('foobar')).to eq('foo')
++      end
++    end
++
++    describe "#stderr_from" do
++      it "works" do
++        allow(monitor).to receive(:stderr_from).with('foobar').and_return("foo")
++        expect(@aruba.stderr_from('foobar')).to eq('foo')
++      end
++    end
++  end
++end
+diff --git a/spec/aruba/platforms/command_monitor_spec.rb b/spec/aruba/platforms/command_monitor_spec.rb
+new file mode 100644
+index 0000000..c5b2b31
+--- /dev/null
++++ b/spec/aruba/platforms/command_monitor_spec.rb
+@@ -0,0 +1,37 @@
++require 'spec_helper'
++
++RSpec.describe Aruba::CommandMonitor do
++  subject do
++    described_class.new(announcer: announcer)
++  end
++
++  let(:announcer) { instance_double(Aruba::Platforms::Announcer) }
++
++  let(:process) { instance_double(Aruba::Processes::BasicProcess) }
++
++  before do
++    allow(process).to receive(:commandline).and_return('foobar')
++    subject.register_command(process)
++  end
++
++  describe "#output_from" do
++    it "works" do
++      allow(process).to receive(:output).and_return('foo')
++      expect(subject.output_from('foobar')).to eq('foo')
++    end
++  end
++
++  describe "#stdout_from" do
++    it "works" do
++      allow(process).to receive(:stdout).and_return('foo')
++      expect(subject.stdout_from('foobar')).to eq('foo')
++    end
++  end
++
++  describe "#stderr_from" do
++    it "works" do
++      allow(process).to receive(:stderr).and_return('foo')
++      expect(subject.stderr_from('foobar')).to eq('foo')
++    end
++  end
++end
diff --git a/debian/patches/series b/debian/patches/series
index 3d10e7e..1771b09 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 002_path-manipulation-for-templates.patch
 003_disable-simplecov-during-tests.patch
 0004-add-require-time-to-avoid-test-failure.patch
+0005-avoid-using-removed-Utils-class-fix-346.patch

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



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