[DRE-commits] [ruby-coercible] 01/05: Add basic RSpec3 support

Cédric Boutillier boutil at moszumanska.debian.org
Wed Aug 12 15:09:20 UTC 2015


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

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

commit 5472e0f2d9009ac62af0760d3bfdabb440b6a0e6
Author: Cédric Boutillier <boutil at debian.org>
Date:   Wed Aug 12 16:55:29 2015 +0200

    Add basic RSpec3 support
---
 debian/patches/rspec3.patch | 259 ++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series       |   1 +
 2 files changed, 260 insertions(+)

diff --git a/debian/patches/rspec3.patch b/debian/patches/rspec3.patch
new file mode 100644
index 0000000..5298100
--- /dev/null
+++ b/debian/patches/rspec3.patch
@@ -0,0 +1,259 @@
+Description: Basic support for RSpec3
+ A more complete patch is available upstream
+ https://github.com/solnic/coercible/commit/053ee5c8ccd41a7b14aff81bb308f4f1c1a2cf5f
+Author: Cédric Boutillier <boutil at debian.org>
+Bug-Debian: http://bugs.debian.org/795031
+Last-Update: 2015-08-12
+
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -1,3 +1,4 @@
++require 'rspec/its'
+ require 'coercible'
+ 
+ include Coercible
+--- a/spec/unit/coercible/coercer/configurable/config_spec.rb
++++ b/spec/unit/coercible/coercer/configurable/config_spec.rb
+@@ -11,11 +11,11 @@
+   }
+ 
+   let(:block)               { Proc.new { |config| config.test } }
+-  let(:configuration)       { mock('configuration') }
+-  let(:configuration_class) { mock('configuration_class') }
++  let(:configuration)       { double('configuration') }
++  let(:configuration_class) { double('configuration_class') }
+ 
+   before do
+-    object.stub!(:configuration_class => configuration_class)
++    object.stub(:configuration_class => configuration_class)
+     configuration_class.should_receive(:build).with(object.config_keys).
+       and_return(configuration)
+     configuration.should_receive(:test)
+--- a/spec/unit/coercible/coercer/date/to_datetime_spec.rb
++++ b/spec/unit/coercible/coercer/date/to_datetime_spec.rb
+@@ -22,7 +22,7 @@
+     let(:datetime) { DateTime.new(2011, 1, 1) }
+ 
+     before do
+-      date.stub!(:to_datetime).and_return(datetime)
++      date.stub(:to_datetime).and_return(datetime)
+     end
+ 
+     it { should equal(datetime) }
+--- a/spec/unit/coercible/coercer/date_time/to_time_spec.rb
++++ b/spec/unit/coercible/coercer/date_time/to_time_spec.rb
+@@ -22,7 +22,7 @@
+     let(:time) { Time.local(2011, 1, 1) }
+ 
+     before do
+-      date_time.stub!(:to_time).and_return(time)
++      date_time.stub(:to_time).and_return(time)
+     end
+ 
+     it { should equal(time) }
+--- a/spec/unit/coercible/coercer/integer/datetime_format_spec.rb
++++ b/spec/unit/coercible/coercer/integer/datetime_format_spec.rb
+@@ -8,7 +8,7 @@
+   context "with Rubinius" do
+     before do
+       unless Coercible.rbx?
+-        Coercible.stub!(:rbx? => true)
++        Coercible.stub(:rbx? => true)
+       end
+     end
+ 
+@@ -18,7 +18,7 @@
+   context "with other Ruby VMs" do
+     before do
+       if Coercible.rbx?
+-        Coercible.stub!(:rbx? => false)
++        Coercible.stub(:rbx? => false)
+       end
+     end
+ 
+--- a/spec/unit/coercible/coercer/integer/datetime_proc_spec.rb
++++ b/spec/unit/coercible/coercer/integer/datetime_proc_spec.rb
+@@ -8,7 +8,7 @@
+   context "with Rubinius" do
+     before do
+       unless Coercible.rbx?
+-        Coercible.stub!(:rbx? => true)
++        Coercible.stub(:rbx? => true)
+       end
+     end
+ 
+--- a/spec/unit/coercible/coercer/date_time/to_date_spec.rb
++++ b/spec/unit/coercible/coercer/date_time/to_date_spec.rb
+@@ -22,7 +22,7 @@
+     let(:date) { Date.new(2011, 1, 1) }
+ 
+     before do
+-      date_time.stub!(:to_date).and_return(date)
++      date_time.stub(:to_date).and_return(date)
+     end
+ 
+     it { should equal(date) }
+--- a/spec/unit/coercible/coercer/hash/to_date_spec.rb
++++ b/spec/unit/coercible/coercer/hash/to_date_spec.rb
+@@ -10,7 +10,7 @@
+     let(:hash)     { {}                     }
+ 
+     before do
+-      Time.stub!(:now).and_return(time_now)  # freeze time
++      Time.stub(:now).and_return(time_now)  # freeze time
+     end
+ 
+     it { should be_instance_of(Date) }
+--- a/spec/unit/coercible/coercer/hash/to_datetime_spec.rb
++++ b/spec/unit/coercible/coercer/hash/to_datetime_spec.rb
+@@ -10,7 +10,7 @@
+     let(:hash)     { {}                     }
+ 
+     before do
+-      Time.stub!(:now).and_return(time_now)  # freeze time
++      Time.stub(:now).and_return(time_now)  # freeze time
+     end
+ 
+     it { should be_instance_of(DateTime) }
+--- a/spec/unit/coercible/coercer/hash/to_time_spec.rb
++++ b/spec/unit/coercible/coercer/hash/to_time_spec.rb
+@@ -10,7 +10,7 @@
+     let(:hash)     { {}                     }
+ 
+     before do
+-      Time.stub!(:now).and_return(time_now)  # freeze time
++      Time.stub(:now).and_return(time_now)  # freeze time
+     end
+ 
+     it { should be_instance_of(Time) }
+--- a/spec/unit/coercible/coercer/time_coercions/to_date_spec.rb
++++ b/spec/unit/coercible/coercer/time_coercions/to_date_spec.rb
+@@ -5,7 +5,7 @@
+ 
+   let(:object)  { coercer.new }
+   let(:coercer) { Class.new(Coercer::Object) { include Coercer::TimeCoercions } }
+-  let(:value)   { mock('value') }
++  let(:value)   { double('value') }
+ 
+   after do
+     Coercer::Object.descendants.delete(coercer)
+--- a/spec/unit/coercible/coercer/time_coercions/to_datetime_spec.rb
++++ b/spec/unit/coercible/coercer/time_coercions/to_datetime_spec.rb
+@@ -5,7 +5,7 @@
+ 
+   let(:object)  { coercer.new }
+   let(:coercer) { Class.new(Coercer::Object) { include Coercer::TimeCoercions } }
+-  let(:value)   { mock('value') }
++  let(:value)   { double('value') }
+ 
+   after do
+     Coercer::Object.descendants.delete(coercer)
+--- a/spec/unit/coercible/coercer/time_coercions/to_string_spec.rb
++++ b/spec/unit/coercible/coercer/time_coercions/to_string_spec.rb
+@@ -5,7 +5,7 @@
+ 
+   let(:object)  { coercer.new }
+   let(:coercer) { Class.new(Coercer::Object) { include Coercer::TimeCoercions } }
+-  let(:value)   { mock('value') }
++  let(:value)   { double('value') }
+ 
+   after do
+     Coercer::Object.descendants.delete(coercer)
+--- a/spec/unit/coercible/coercer/time_coercions/to_time_spec.rb
++++ b/spec/unit/coercible/coercer/time_coercions/to_time_spec.rb
+@@ -5,7 +5,7 @@
+ 
+   let(:object)  { coercer.new }
+   let(:coercer) { Class.new(Coercer::Object) { include Coercer::TimeCoercions } }
+-  let(:value)   { mock('value') }
++  let(:value)   { double('value') }
+ 
+   after do
+     Coercer::Object.descendants.delete(coercer)
+--- a/spec/unit/coercible/coercer/object/to_hash_spec.rb
++++ b/spec/unit/coercible/coercer/object/to_hash_spec.rb
+@@ -4,13 +4,13 @@
+   subject { object.to_hash(value) }
+ 
+   let(:object) { described_class.new }
+-  let(:value)  { stub('value')   }
++  let(:value)  { double('value')   }
+ 
+   context 'when the value responds to #to_hash' do
+-    let(:coerced) { stub('coerced') }
++    let(:coerced) { double('coerced') }
+ 
+     before do
+-      value.should_receive(:to_hash).with().and_return(coerced)
++      value.should_receive(:to_hash).with(no_args).and_return(coerced)
+     end
+ 
+     it { should be(coerced) }
+--- a/spec/unit/coercible/coercer/object/to_integer_spec.rb
++++ b/spec/unit/coercible/coercer/object/to_integer_spec.rb
+@@ -4,13 +4,13 @@
+   subject { object.to_integer(value) }
+ 
+   let(:object) { described_class.new }
+-  let(:value)  { stub('value')   }
++  let(:value)  { double('value')   }
+ 
+   context 'when the value responds to #to_int' do
+-    let(:coerced) { stub('coerced') }
++    let(:coerced) { double('coerced') }
+ 
+     before do
+-      value.should_receive(:to_int).with().and_return(coerced)
++      value.should_receive(:to_int).with(no_args).and_return(coerced)
+     end
+ 
+     it { should be(coerced) }
+--- a/spec/unit/coercible/coercer/object/to_string_spec.rb
++++ b/spec/unit/coercible/coercer/object/to_string_spec.rb
+@@ -7,10 +7,10 @@
+   let(:value)  { Object.new      }
+ 
+   context 'when the value responds to #to_str' do
+-    let(:coerced) { stub('coerced') }
++    let(:coerced) { double('coerced') }
+ 
+     before do
+-      value.should_receive(:to_str).with().and_return(coerced)
++      value.should_receive(:to_str).with(no_args).and_return(coerced)
+     end
+ 
+     it { should be(coerced) }
+--- a/spec/unit/coercible/coercer/object/to_array_spec.rb
++++ b/spec/unit/coercible/coercer/object/to_array_spec.rb
+@@ -9,7 +9,7 @@
+ 
+   context 'when the value responds to #to_ary' do
+     before do
+-      value.should_receive(:to_ary).with().and_return(coerced)
++      value.should_receive(:to_ary).with(no_args).and_return(coerced)
+     end
+ 
+     it { should be(coerced) }
+@@ -22,7 +22,7 @@
+ 
+   context 'when the value responds to #to_a but not #to_ary' do
+     before do
+-      value.should_receive(:to_a).with().and_return(coerced)
++      value.should_receive(:to_a).with(no_args).and_return(coerced)
+     end
+ 
+     it { should be(coerced) }
+@@ -36,11 +36,11 @@
+ 
+   context 'when the value returns nil from #to_ary' do
+     before do
+-      value.should_receive(:to_ary).with().and_return(nil)
++      value.should_receive(:to_ary).with(no_args).and_return(nil)
+     end
+ 
+     it 'calls #to_a as a fallback' do
+-      value.should_receive(:to_a).with().and_return(coerced)
++      value.should_receive(:to_a).with(no_args).and_return(coerced)
+       should be(coerced)
+     end
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b503a61..d4142a5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 move_support_inside_coercible_subdir.patch
 remove_coverage_from_spec_helper.patch
+rspec3.patch

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



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