[DRE-commits] [ruby-dataobjects] 03/05: Make distributed specs support RSpec3

Balasankar C balasankarc-guest at moszumanska.debian.org
Tue Jul 21 16:49:35 UTC 2015


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

balasankarc-guest pushed a commit to branch master
in repository ruby-dataobjects.

commit 951cfd62246f4ab25837509cc552b2193b5dc22e
Author: Balasankar C <balasankarc at autistici.org>
Date:   Tue Jul 21 22:18:30 2015 +0530

    Make distributed specs support RSpec3
---
 debian/patches/0060-lib-spec-support-rspec3.patch | 1196 +++++++++++++++++++++
 debian/patches/series                             |    3 +
 2 files changed, 1199 insertions(+)

diff --git a/debian/patches/0060-lib-spec-support-rspec3.patch b/debian/patches/0060-lib-spec-support-rspec3.patch
new file mode 100644
index 0000000..09f9168
--- /dev/null
+++ b/debian/patches/0060-lib-spec-support-rspec3.patch
@@ -0,0 +1,1196 @@
+Description: Make distributed spec files support RSpec3
+ The spec files inside lib/data_objects/spec/ have to support RSpec3 for other 
+ packages to work. Made them RSpec3 happy
+Author: Balasankar C <balasankarc at autistici.org>
+Last-Update: 2015-07-21
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/data_objects/spec/shared/command_spec.rb
++++ b/lib/data_objects/spec/shared/command_spec.rb
+@@ -18,9 +18,9 @@
+     @connection.close
+   end
+ 
+-  it { @command.should be_kind_of(DataObjects::Command) }
++  it { expect(@command).to be_kind_of(DataObjects::Command) }
+ 
+-  it { @command.should respond_to(:execute_non_query) }
++  it { expect(@command).to respond_to(:execute_non_query) }
+ 
+   describe 'execute_non_query' do
+ 
+@@ -49,7 +49,7 @@
+     describe 'with a valid statement' do
+ 
+       it 'should not raise an error with an explicit nil as parameter' do
+-        expect { @arg_command.execute_non_query(nil, nil) }.not_to raise_error(ArgumentError)
++        expect { @arg_command.execute_non_query(nil, nil) }.not_to raise_error
+       end
+ 
+     end
+@@ -61,14 +61,14 @@
+       end
+ 
+       it 'should not raise an error' do
+-        expect { @command_with_quotes.execute_non_query }.not_to raise_error(ArgumentError)
++        expect { @command_with_quotes.execute_non_query }.not_to raise_error
+       end
+ 
+     end
+ 
+   end
+ 
+-  it { @command.should respond_to(:execute_reader) }
++  it { expect(@command).to respond_to(:execute_reader) }
+ 
+   describe 'execute_reader' do
+ 
+@@ -98,15 +98,15 @@
+     describe 'with a valid reader' do
+ 
+       it 'should not raise an error with an explicit nil as parameter' do
+-        expect { @arg_reader.execute_reader(nil, nil) }.not_to raise_error(ArgumentError)
++        expect { @arg_reader.execute_reader(nil, nil) }.not_to raise_error
+       end
+ 
+       unless defined?(JRUBY)
+         it 'returns an empty reader if the query does not return a result' do
+           runs_command   = @connection.create_command("UPDATE widgets SET name = '' WHERE name = ''")
+           res = runs_command.execute_reader
+-          res.fields.should == []
+-          res.next!.should == false
++          expect(res.fields).to eq([])
++          expect(res.next!).to eq(false)
+         end
+       end
+ 
+@@ -119,7 +119,7 @@
+       end
+ 
+       it 'should not raise an error' do
+-        expect { @reader_with_quotes.execute_reader(nil) }.not_to raise_error(ArgumentError)
++        expect { @reader_with_quotes.execute_reader(nil) }.not_to raise_error
+       end
+ 
+     end
+@@ -127,7 +127,7 @@
+ 
+   end
+ 
+-  it { @command.should respond_to(:set_types) }
++  it { expect(@command).to respond_to(:set_types) }
+ 
+   describe 'set_types' do
+ 
+@@ -163,33 +163,33 @@
+ 
+       it 'should not raise an error with correct number of types' do
+         @reader.set_types(String, String)
+-        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error(ArgumentError)
+-        expect { @result.next!  }.not_to raise_error(DataObjects::DataError)
+-        expect { @result.values }.not_to raise_error(DataObjects::DataError)
++        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error
++        expect { @result.next!  }.not_to raise_error
++        expect { @result.values }.not_to raise_error
+         @result.close
+       end
+ 
+       it 'should also support old style array argument types' do
+         @reader.set_types([String, String])
+-        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error(ArgumentError)
+-        expect { @result.next!  }.not_to raise_error(DataObjects::DataError)
+-        expect { @result.values }.not_to raise_error(DataObjects::DataError)
++        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error
++        expect { @result.next!  }.not_to raise_error
++        expect { @result.values }.not_to raise_error
+         @result.close
+       end
+ 
+       it 'should allow subtype types' do
+         class MyString < String; end
+         @reader.set_types(MyString, String)
+-        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error(ArgumentError)
+-        expect { @result.next!  }.not_to raise_error(DataObjects::DataError)
+-        expect { @result.values }.not_to raise_error(DataObjects::DataError)
++        expect { @result = @reader.execute_reader('Buy this product now!') }.not_to raise_error
++        expect { @result.next!  }.not_to raise_error
++        expect { @result.values }.not_to raise_error
+         @result.close
+       end
+     end
+ 
+   end
+ 
+-  it { @command.should respond_to(:to_s) }
++  it { expect(@command).to respond_to(:to_s) }
+ 
+   describe 'to_s' do
+ 
+@@ -234,10 +234,9 @@
+       @finish = Time.now
+     end
+ 
+-    #Temporarily deactivate this example, as it currently fails with hurd-i386 and freebsd-i386
+-    xit "should finish within 2 seconds" do
++    it "should finish within 2 seconds" do
+       pending_if("Ruby on Windows doesn't support asynchronous operations", WINDOWS) do
+-        (@finish - @start).should < 2
++        expect(@finish - @start).to be < 2
+       end
+     end
+ 
+--- a/lib/data_objects/spec/shared/connection_spec.rb
++++ b/lib/data_objects/spec/shared/connection_spec.rb
+@@ -22,15 +22,15 @@
+     @connection.close
+   end
+ 
+-  it { @connection.should be_kind_of(DataObjects::Connection) }
+-  it { @connection.should be_kind_of(DataObjects::Pooling) }
++  it { expect(@connection).to be_kind_of(DataObjects::Connection) }
++  it { expect(@connection).to be_kind_of(DataObjects::Pooling) }
+ 
+-  it { @connection.should respond_to(:dispose) }
+-  it 'should respond to #create_command' do @connection.should respond_to(:create_command)          end
++  it { expect(@connection).to respond_to(:dispose) }
++  it 'should respond to #create_command' do expect(@connection).to respond_to(:create_command)          end
+ 
+   describe 'create_command' do
+     it 'should be a kind of Command' do
+-      @connection.create_command('This is a dummy command').should be_kind_of(DataObjects::Command)
++      expect(@connection.create_command('This is a dummy command')).to be_kind_of(DataObjects::Command)
+     end
+   end
+ 
+@@ -46,13 +46,13 @@
+               :path     => @database
+             )
+       conn = DataObjects::Connection.new(uri)
+-      test_connection(conn).should == 1
++      expect(test_connection(conn)).to eq(1)
+       conn.close
+     end
+ 
+     it 'should work with non-JDBC URLs' do
+       conn = DataObjects::Connection.new("#{CONFIG.uri.sub(/jdbc:/, '')}")
+-      test_connection(conn).should == 1
++      expect(test_connection(conn)).to eq(1)
+       conn.close
+     end
+ 
+@@ -65,7 +65,7 @@
+       it 'dispose should be true' do
+         conn = DataObjects::Connection.new(CONFIG.uri)
+         conn.detach
+-        conn.dispose.should be_true
++        expect(conn.dispose).to be_truthy
+         conn.close
+       end
+ 
+@@ -84,7 +84,7 @@
+         @closed_connection = nil
+       end
+ 
+-      it { @closed_connection.dispose.should be_false }
++      it { expect(@closed_connection.dispose).to be_falsey }
+ 
+       it 'should raise an error on creating a command' do
+         expect {
+@@ -114,19 +114,19 @@
+     end
+ 
+     it 'should raise an error if bad username is given' do
+-      connecting_with("#{@driver}://thisreallyshouldntexist:#{@password}@#{@host}:#{@port}#{@database}").should raise_error #(ArgumentError, DataObjects::Error)
++      expect(connecting_with("#{@driver}://thisreallyshouldntexist:#{@password}@#{@host}:#{@port}#{@database}")).to raise_error #(ArgumentError, DataObjects::Error)
+     end
+ 
+     it 'should raise an error if bad password is given' do
+-      connecting_with("#{@driver}://#{@user}:completelyincorrectpassword:#{@host}:#{@port}#{@database}").should raise_error #(ArgumentError, DataObjects::Error)
++      expect(connecting_with("#{@driver}://#{@user}:completelyincorrectpassword:#{@host}:#{@port}#{@database}")).to raise_error #(ArgumentError, DataObjects::Error)
+     end
+ 
+     it 'should raise an error if an invalid port is given' do
+-      connecting_with("#{@driver}://#{@user}:#{@password}:#{@host}:648646543#{@database}").should raise_error #(ArgumentError, DataObjects::Error)
++      expect(connecting_with("#{@driver}://#{@user}:#{@password}:#{@host}:648646543#{@database}")).to raise_error #(ArgumentError, DataObjects::Error)
+     end
+ 
+     it 'should raise an error if an invalid database is given' do
+-      connecting_with("#{@driver}://#{@user}:#{@password}:#{@host}:#{@port}/someweirddatabase").should raise_error #(ArgumentError, DataObjects::Error)
++      expect(connecting_with("#{@driver}://#{@user}:#{@password}:#{@host}:#{@port}/someweirddatabase")).to raise_error #(ArgumentError, DataObjects::Error)
+     end
+ 
+   end
+@@ -137,7 +137,7 @@
+   describe 'with a URI without a database' do
+     it 'should connect properly' do
+       conn = DataObjects::Connection.new("#{@driver}://#{@user}:#{@password}@#{@host}:#{@port}")
+-      test_connection(conn).should == 1
++      expect(test_connection(conn)).to eq(1)
+     end
+   end
+ end
+@@ -146,7 +146,7 @@
+ 
+   it 'should work with JDBC URLs' do
+     conn = DataObjects::Connection.new(CONFIG.jdbc_uri || "jdbc:#{CONFIG.uri.sub(/jdbc:/, '')}")
+-    test_connection(conn).should == 1
++    expect(test_connection(conn)).to eq(1)
+   end
+ 
+ end if defined? JRUBY_VERSION
+@@ -158,7 +158,7 @@
+ 
+       it 'should connect securely' do
+         conn = DataObjects::Connection.new("#{CONFIG.uri}?#{CONFIG.ssl}")
+-        conn.secure?.should be_true
++        expect(conn.secure?).to be_truthy
+         conn.close
+       end
+ 
+@@ -169,7 +169,7 @@
+ 
+     it 'should not connect securely' do
+       conn = DataObjects::Connection.new(CONFIG.uri)
+-      conn.secure?.should be_false
++      expect(conn.secure?).to be_falsey
+       conn.close
+     end
+ 
+@@ -229,8 +229,8 @@
+       it 'should connect' do
+         begin
+           c = DataObjects::Connection.new("java:comp/env/jdbc/mydb?driver=#{CONFIG.driver}")
+-          c.should_not be_nil
+-          test_connection(c).should == 1
++          expect(c).not_to be_nil
++          expect(test_connection(c)).to eq(1)
+         ensure
+           c.close if c
+         end
+--- a/lib/data_objects/spec/shared/encoding_spec.rb
++++ b/lib/data_objects/spec/shared/encoding_spec.rb
+@@ -10,10 +10,10 @@
+       @connection.close
+     end
+ 
+-    it { @connection.should respond_to(:character_set) }
++    it { expect(@connection).to respond_to(:character_set) }
+ 
+     it 'uses utf8 by default' do
+-      @connection.character_set.should == 'UTF-8'
++      expect(@connection.character_set).to eq('UTF-8')
+     end
+ 
+     describe 'sets the character set through the URI' do
+@@ -24,7 +24,7 @@
+ 
+       after { @latin1_connection.close }
+ 
+-      it { @latin1_connection.character_set.should == 'ISO-8859-1' }
++      it { expect(@latin1_connection.character_set).to eq('ISO-8859-1') }
+     end
+ 
+     describe 'uses UTF-8 when an invalid encoding is given' do
+@@ -34,7 +34,7 @@
+ 
+       after { @latin1_connection.close }
+ 
+-      it { @latin1_connection.character_set.should == 'UTF-8' }
++      it { expect(@latin1_connection.character_set).to eq('UTF-8') }
+     end
+   end
+ end
+@@ -69,10 +69,10 @@
+         end
+ 
+         it 'should return UTF-8 encoded String' do
+-          @values.first.should be_kind_of(String)
+-          @values.first.encoding.name.should == 'UTF-8'
+-          @values.last.should be_kind_of(String)
+-          @values.last.encoding.name.should == 'UTF-8'
++          expect(@values.first).to be_kind_of(String)
++          expect(@values.first.encoding.name).to eq('UTF-8')
++          expect(@values.last).to be_kind_of(String)
++          expect(@values.last.encoding.name).to eq('UTF-8')
+         end
+       end
+ 
+@@ -90,8 +90,8 @@
+         end
+ 
+         it 'should return ASCII-8BIT encoded ByteArray' do
+-          @values.first.should be_kind_of(::Extlib::ByteArray)
+-          @values.first.encoding.name.should == 'ASCII-8BIT'
++          expect(@values.first).to be_kind_of(::Extlib::ByteArray)
++          expect(@values.first.encoding.name).to eq('ASCII-8BIT')
+         end
+       end
+     end
+@@ -132,10 +132,10 @@
+         end
+ 
+         it 'should return ISO-8859-1 encoded String' do
+-          @values.first.should be_kind_of(String)
+-          @values.first.encoding.name.should == 'ISO-8859-1'
+-          @values.last.should be_kind_of(String)
+-          @values.last.encoding.name.should == 'ISO-8859-1'
++          expect(@values.first).to be_kind_of(String)
++          expect(@values.first.encoding.name).to eq('ISO-8859-1')
++          expect(@values.last).to be_kind_of(String)
++          expect(@values.last.encoding.name).to eq('ISO-8859-1')
+         end
+       end
+ 
+@@ -153,8 +153,8 @@
+         end
+ 
+         it 'should return ASCII-8BIT encoded ByteArray' do
+-          @values.first.should be_kind_of(::Extlib::ByteArray)
+-          @values.first.encoding.name.should == 'ASCII-8BIT'
++          expect(@values.first).to be_kind_of(::Extlib::ByteArray)
++          expect(@values.first.encoding.name).to eq('ASCII-8BIT')
+         end
+       end
+     end
+--- a/lib/data_objects/spec/shared/reader_spec.rb
++++ b/lib/data_objects/spec/shared/reader_spec.rb
+@@ -16,26 +16,26 @@
+     @connection.close
+   end
+ 
+-  it { @reader.should respond_to(:fields) }
++  it { expect(@reader).to respond_to(:fields) }
+ 
+   describe 'fields' do
+ 
+     it 'should return the correct fields in the reader' do
+       # we downcase the field names as some drivers such as do_derby, do_h2,
+       # do_hsqldb, do_oracle return the field names as uppercase
+-      @reader.fields.should be_array_case_insensitively_equal_to(['code', 'name'])
++      expect(@reader.fields).to be_array_case_insensitively_equal_to(['code', 'name'])
+     end
+ 
+     it 'should return the field alias as the name, when the SQL AS keyword is specified' do
+       reader = @connection.create_command("SELECT code AS codigo, name AS nombre FROM widgets WHERE ad_description = ? order by id").execute_reader('Buy this product now!')
+-      reader.fields.should_not be_array_case_insensitively_equal_to(['code',   'name'])
+-      reader.fields.should     be_array_case_insensitively_equal_to(['codigo', 'nombre'])
++      expect(reader.fields).not_to be_array_case_insensitively_equal_to(['code',   'name'])
++      expect(reader.fields).to     be_array_case_insensitively_equal_to(['codigo', 'nombre'])
+       reader.close
+     end
+ 
+   end
+ 
+-  it { @reader.should respond_to(:values) }
++  it { expect(@reader).to respond_to(:values) }
+ 
+   describe 'values' do
+ 
+@@ -54,7 +54,7 @@
+       end
+ 
+       it 'should return the correct first set of in the reader' do
+-        @reader.values.should == ["W0000001", "Widget 1"]
++        expect(@reader.values).to eq(["W0000001", "Widget 1"])
+       end
+ 
+     end
+@@ -66,7 +66,7 @@
+       end
+ 
+       it 'should return the correct first set of in the reader' do
+-        @reader.values.should == ["W0000002", "Widget 2"]
++        expect(@reader.values).to eq(["W0000002", "Widget 2"])
+       end
+ 
+     end
+@@ -84,14 +84,14 @@
+ 
+   end
+ 
+-  it { @reader.should respond_to(:close) }
++  it { expect(@reader).to respond_to(:close) }
+ 
+   describe 'close' do
+ 
+     describe 'on an open reader' do
+ 
+       it 'should return true' do
+-        @reader.close.should be_true
++        expect(@reader.close).to be_truthy
+       end
+ 
+     end
+@@ -103,21 +103,21 @@
+       end
+ 
+       it 'should return false' do
+-        @reader.close.should be_false
++        expect(@reader.close).to be_falsey
+       end
+ 
+     end
+ 
+   end
+ 
+-  it { @reader.should respond_to(:next!) }
++  it { expect(@reader).to respond_to(:next!) }
+ 
+   describe 'next!' do
+ 
+     describe 'successfully moving the cursor initially' do
+ 
+       it 'should return true' do
+-        @reader.next!.should be_true
++        expect(@reader.next!).to be_truthy
+       end
+ 
+     end
+@@ -129,9 +129,9 @@
+       end
+ 
+       it 'should move the cursor to the next value' do
+-        @reader.values.should == ["W0000001", "Widget 1"]
+-        lambda { @reader.next! }.should change { @reader.values }
+-        @reader.values.should == ["W0000002", "Widget 2"]
++        expect(@reader.values).to eq(["W0000001", "Widget 1"])
++        expect { @reader.next! }.to change { @reader.values }
++        expect(@reader.values).to eq(["W0000002", "Widget 2"])
+       end
+ 
+     end
+@@ -143,62 +143,62 @@
+       end
+ 
+       it 'should return false when the end is reached' do
+-        @reader.next!.should be_false
++        expect(@reader.next!).to be_falsey
+       end
+ 
+     end
+ 
+   end
+ 
+-  it { @reader.should respond_to(:field_count) }
++  it { expect(@reader).to respond_to(:field_count) }
+ 
+   describe 'field_count' do
+ 
+     it 'should count the number of fields' do
+-      @reader.field_count.should == 2
++      expect(@reader.field_count).to eq(2)
+     end
+ 
+   end
+ 
+-  it { @reader.should respond_to(:values) }
++  it { expect(@reader).to respond_to(:values) }
+ 
+   describe 'each' do
+ 
+     it 'should yield each row to the block for multiple columns' do
+       rows_yielded = 0
+       @reader.each do |row|
+-        row.should respond_to(:[])
++        expect(row).to respond_to(:[])
+ 
+-        row.size.should == 2
++        expect(row.size).to eq(2)
+ 
+         # the field names need to be case insensitive as some drivers such as
+         # do_derby, do_h2, do_hsqldb return the field names as uppercase
+-        (row['name'] || row['NAME']).should be_kind_of(String)
+-        (row['code'] || row['CODE']).should be_kind_of(String)
++        expect(row['name'] || row['NAME']).to be_kind_of(String)
++        expect(row['code'] || row['CODE']).to be_kind_of(String)
+ 
+         rows_yielded += 1
+       end
+-      rows_yielded.should == 15
++      expect(rows_yielded).to eq(15)
+     end
+ 
+     it 'should yield each row to the block for a single column' do
+       rows_yielded = 0
+       @reader2.each do |row|
+-        row.should respond_to(:[])
++        expect(row).to respond_to(:[])
+ 
+-        row.size.should == 1
++        expect(row.size).to eq(1)
+ 
+         # the field names need to be case insensitive as some drivers such as
+         # do_derby, do_h2, do_hsqldb return the field names as uppercase
+-        (row['code'] || row['CODE']).should be_kind_of(String)
++        expect(row['code'] || row['CODE']).to be_kind_of(String)
+ 
+         rows_yielded += 1
+       end
+-      rows_yielded.should == 15
++      expect(rows_yielded).to eq(15)
+     end
+ 
+     it 'should return the reader' do
+-      @reader.each { |row| }.should equal(@reader)
++      expect(@reader.each { |row| }).to equal(@reader)
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/result_spec.rb
++++ b/lib/data_objects/spec/shared/result_spec.rb
+@@ -13,12 +13,12 @@
+     @connection.close
+   end
+ 
+-  it { @result.should respond_to(:affected_rows) }
++  it { expect(@result).to respond_to(:affected_rows) }
+ 
+   describe 'affected_rows' do
+ 
+     it 'should return the number of affected rows' do
+-      @result.affected_rows.should == 1
++      expect(@result.affected_rows).to eq(1)
+     end
+ 
+   end
+@@ -42,11 +42,11 @@
+       @connection.close
+     end
+ 
+-    it { @result.should respond_to(:affected_rows) }
++    it { expect(@result).to respond_to(:affected_rows) }
+ 
+     it 'should return the insert_id' do
+       # This is actually the 2nd record inserted
+-      @result.insert_id.should == 2
++      expect(@result.insert_id).to eq(2)
+     end
+ 
+   end
+@@ -71,7 +71,7 @@
+ 
+     it 'should return the insert_id' do
+       # This is actually the 2nd record inserted
+-      @result.insert_id.should be_nil
++      expect(@result.insert_id).to be_nil
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/array_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/array_spec.rb
+@@ -27,7 +27,7 @@
+       while(@reader.next!) do
+         counter += 1
+       end
+-      counter.should == 4
++      expect(counter).to eq(4)
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/bigdecimal_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/bigdecimal_spec.rb
+@@ -29,12 +29,12 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(BigDecimal)
++        expect(@values.first).to be_kind_of(BigDecimal)
+       end
+ 
+       it 'should return the correct result' do
+         # rounding seems necessary for the jruby do_derby driver
+-        @values.first.round(2).should == 10.23
++        expect(@values.first.round(2)).to eq(10.23)
+       end
+ 
+     end
+@@ -54,11 +54,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return the correct result' do
+-       @values.first.should be_nil
++       expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -78,7 +78,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == 2
++      expect(@values.first).to eq(2)
+     end
+ 
+   end
+@@ -114,11 +114,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(BigDecimal)
++        expect(@values.first).to be_kind_of(BigDecimal)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == 50.23
++        expect(@values.first).to eq(50.23)
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/boolean_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/boolean_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(FalseClass)
++        expect(@values.first).to be_kind_of(FalseClass)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == false
++        expect(@values.first).to eq(false)
+       end
+ 
+     end
+@@ -53,11 +53,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(TrueClass)
++        expect(@values.first).to be_kind_of(TrueClass)
+       end
+ 
+       it 'should return the correct result' do
+-       @values.first.should be_true
++       expect(@values.first).to be_truthy
+       end
+ 
+     end
+@@ -77,11 +77,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return the correct result' do
+-       @values.first.should be_nil
++       expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -101,7 +101,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == 2
++      expect(@values.first).to eq(2)
+     end
+ 
+   end
+@@ -137,11 +137,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(FalseClass)
++        expect(@values.first).to be_kind_of(FalseClass)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == false
++        expect(@values.first).to eq(false)
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/byte_array_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/byte_array_spec.rb
+@@ -27,11 +27,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(::Extlib::ByteArray)
++        expect(@values.first).to be_kind_of(::Extlib::ByteArray)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == "CAD \001 \000 DRAWING"
++        expect(@values.first).to eq("CAD \001 \000 DRAWING")
+       end
+ 
+     end
+@@ -51,11 +51,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(::Extlib::ByteArray)
++        expect(@values.first).to be_kind_of(::Extlib::ByteArray)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == "CAD \001 \000 DRAWING"
++        expect(@values.first).to eq("CAD \001 \000 DRAWING")
+       end
+ 
+     end
+@@ -76,7 +76,7 @@
+ 
+     it 'should return the correct entry' do
+       #Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should == 'Buy this product now!'
++      expect(@values.first).to eq('Buy this product now!')
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/class_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/class_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Class)
++        expect(@values.first).to be_kind_of(Class)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == String
++        expect(@values.first).to eq(String)
+       end
+ 
+     end
+@@ -53,7 +53,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == "String"
++      expect(@values.first).to eq("String")
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/date_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/date_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Date)
++        expect(@values.first).to be_kind_of(Date)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == Date.civil(2008, 2, 14)
++        expect(@values.first).to eq(Date.civil(2008, 2, 14))
+       end
+ 
+     end
+@@ -53,11 +53,11 @@
+       end
+ 
+       it 'should return a nil class' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return nil' do
+-       @values.first.should be_nil
++       expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -78,7 +78,7 @@
+ 
+     it 'should return the correct entry' do
+       #Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should satisfy { |val| val == 1 or val == 0 }
++      expect(@values.first).to satisfy { |val| val == 1 or val == 0 }
+     end
+ 
+   end
+@@ -114,11 +114,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Date)
++        expect(@values.first).to be_kind_of(Date)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == Date.civil(2008, 2, 14)
++        expect(@values.first).to eq(Date.civil(2008, 2, 14))
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/datetime_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/datetime_spec.rb
+@@ -31,13 +31,13 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(DateTime)
++        expect(@values.first).to be_kind_of(DateTime)
+       end
+ 
+       it 'should return the correct result' do
+         date = @values.first
+         local_offset = Rational(Time.local(2008, 2, 14).utc_offset, 86400)
+-        date.should == DateTime.civil(2008, 2, 14, 00, 31, 12, local_offset)
++        expect(date).to eq(DateTime.civil(2008, 2, 14, 00, 31, 12, local_offset))
+       end
+ 
+     end
+@@ -57,11 +57,11 @@
+       end
+ 
+       it 'should return a nil class' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return nil' do
+-       @values.first.should be_nil
++       expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -83,11 +83,11 @@
+       end
+ 
+       it 'should return the correct offset in Feb' do
+-        (@feb_row.first.offset * 86400).to_i.should == Time.local(2008, 2, 14, 0, 31, 12).utc_offset
++        expect((@feb_row.first.offset * 86400).to_i).to eq(Time.local(2008, 2, 14, 0, 31, 12).utc_offset)
+       end
+ 
+       it 'should return the correct offset in Jul' do
+-        (@jul_row.first.offset * 86400).to_i.should == Time.local(2008, 7, 14, 0, 31, 12).utc_offset
++        expect((@jul_row.first.offset * 86400).to_i).to eq(Time.local(2008, 7, 14, 0, 31, 12).utc_offset)
+       end
+ 
+     end
+@@ -109,7 +109,7 @@
+ 
+     it 'should return the correct entry' do
+       #Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should satisfy { |val| val == 0 or val == 1 }
++      expect(@values.first).to satisfy { |val| val == 0 or val == 1 }
+     end
+ 
+   end
+@@ -145,11 +145,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(DateTime)
++        expect(@values.first).to be_kind_of(DateTime)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == Time.local(2008, 2, 14, 00, 31, 12).send(:to_datetime)
++        expect(@values.first).to eq(Time.local(2008, 2, 14, 00, 31, 12).send(:to_datetime))
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/float_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/float_spec.rb
+@@ -29,12 +29,12 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Float)
++        expect(@values.first).to be_kind_of(Float)
+       end
+ 
+       it 'should return the correct result' do
+        #Some of the drivers starts autoincrementation from 0 not 1
+-       @values.first.should satisfy { |val| val == 1.0 or val == 0.0 }
++       expect(@values.first).to satisfy { |val| val == 1.0 or val == 0.0 }
+       end
+ 
+     end
+@@ -54,11 +54,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return the correct result' do
+-       @values.first.should be_nil
++       expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -78,7 +78,7 @@
+ 
+     it 'should return the correct entry' do
+       #Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should satisfy { |val| val == 1 or val == 2 }
++      expect(@values.first).to satisfy { |val| val == 1 or val == 2 }
+     end
+ 
+   end
+@@ -114,13 +114,13 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Float)
+-        @values.last.should be_kind_of(Float)
++        expect(@values.first).to be_kind_of(Float)
++        expect(@values.last).to be_kind_of(Float)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == 13.4
+-        BigDecimal.new(@values.last.to_s).round(2).should == 10.23
++        expect(@values.first).to eq(13.4)
++        expect(BigDecimal.new(@values.last.to_s).round(2)).to eq(10.23)
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/integer_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/integer_spec.rb
+@@ -27,12 +27,12 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Integer)
++        expect(@values.first).to be_kind_of(Integer)
+       end
+ 
+       it 'should return the correct result' do
+         #Some of the drivers starts autoincrementation from 0 not 1
+-        @values.first.should satisfy { |val| val == 1 or val == 0 }
++        expect(@values.first).to satisfy { |val| val == 1 or val == 0 }
+       end
+ 
+     end
+@@ -52,11 +52,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Integer)
++        expect(@values.first).to be_kind_of(Integer)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == 13
++        expect(@values.first).to eq(13)
+       end
+ 
+     end
+@@ -76,7 +76,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == 2
++      expect(@values.first).to eq(2)
+     end
+ 
+   end
+@@ -95,7 +95,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == 2147483648
++      expect(@values.first).to eq(2147483648)
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/nil_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/nil_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == nil
++        expect(@values.first).to eq(nil)
+       end
+ 
+     end
+@@ -73,7 +73,7 @@
+       end
+ 
+       it 'should return the correct entry' do
+-        @reader.next!.should be_false
++        expect(@reader.next!).to be_falsey
+       end
+ 
+     end
+@@ -111,11 +111,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == nil
++        expect(@values.first).to eq(nil)
+       end
+ 
+     end
+--- a/lib/data_objects/spec/shared/typecast/other_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/other_spec.rb
+@@ -39,7 +39,7 @@
+     end
+ 
+     it 'should return the correct entry' do
+-      @values.first.should == 'Buy this product now!'
++      expect(@values.first).to eq('Buy this product now!')
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/range_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/range_spec.rb
+@@ -27,7 +27,7 @@
+       while(@reader.next!) do
+         counter += 1
+       end
+-      counter.should == 4
++      expect(counter).to eq(4)
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/string_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/string_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(String)
++        expect(@values.first).to be_kind_of(String)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == "W0000001"
++        expect(@values.first).to eq("W0000001")
+       end
+ 
+     end
+@@ -53,11 +53,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(String)
++        expect(@values.first).to be_kind_of(String)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == "0"
++        expect(@values.first).to eq("0")
+       end
+ 
+     end
+@@ -78,7 +78,7 @@
+ 
+     it 'should return the correct entry' do
+       # Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should satisfy { |val| val == 1 or val == 2 }
++      expect(@values.first).to satisfy { |val| val == 1 or val == 2 }
+     end
+ 
+   end
+@@ -96,27 +96,27 @@
+ 
+       it 'should write a multibyte String' do
+         @command = @connection.create_command('INSERT INTO users (name) VALUES(?)')
+-        expect { @command.execute_non_query(name) }.not_to raise_error(DataObjects::DataError)
++        expect { @command.execute_non_query(name) }.not_to raise_error
+       end
+ 
+       it 'should read back the multibyte String' do
+         @command = @connection.create_command('SELECT name FROM users WHERE name = ?')
+         @reader = @command.execute_reader(name)
+         @reader.next!
+-        @reader.values.first.should == name
++        expect(@reader.values.first).to eq(name)
+         @reader.close
+       end
+ 
+       it 'should write a multibyte String (without query parameters)' do
+         @command = @connection.create_command("INSERT INTO users (name) VALUES(#{@n}\'#{name}\')")
+-        expect { @command.execute_non_query }.not_to raise_error(DataObjects::DataError)
++        expect { @command.execute_non_query }.not_to raise_error
+       end
+ 
+       it 'should read back the multibyte String (without query parameters)' do
+         @command = @connection.create_command("SELECT name FROM users WHERE name = #{@n}\'#{name}\'")
+         @reader = @command.execute_reader
+         @reader.next!
+-        @reader.values.first.should == name
++        expect(@reader.values.first).to eq(name)
+         @reader.close
+       end
+ 
+@@ -139,7 +139,7 @@
+ 
+     it 'should return the correct entry' do
+       # Some of the drivers starts autoincrementation from 0 not 1
+-      @values.first.should satisfy { |val| val == 1 or val == 2 }
++      expect(@values.first).to satisfy { |val| val == 1 or val == 2 }
+     end
+ 
+   end
+--- a/lib/data_objects/spec/shared/typecast/time_spec.rb
++++ b/lib/data_objects/spec/shared/typecast/time_spec.rb
+@@ -29,11 +29,11 @@
+       end
+ 
+       it 'should return the correctly typed result' do
+-        @values.first.should be_kind_of(Time)
++        expect(@values.first).to be_kind_of(Time)
+       end
+ 
+       it 'should return the correct result' do
+-        @values.first.should == Time.local(2008, 2, 14)
++        expect(@values.first).to eq(Time.local(2008, 2, 14))
+       end
+ 
+     end
+@@ -53,11 +53,11 @@
+       end
+ 
+       it 'should return a nil class' do
+-        @values.first.should be_kind_of(NilClass)
++        expect(@values.first).to be_kind_of(NilClass)
+       end
+ 
+       it 'should return nil' do
+-        @values.first.should be_nil
++        expect(@values.first).to be_nil
+       end
+ 
+     end
+@@ -78,7 +78,7 @@
+ 
+     it 'should return the correct entry' do
+        #Some of the drivers starts autoincrementation from 0 not 1
+-       @values.first.should satisfy { |val| val == 1 or val == 0 }
++       expect(@values.first).to satisfy { |val| val == 1 or val == 0 }
+     end
+ 
+   end
+@@ -112,10 +112,10 @@
+   end
+ 
+   it 'should handle variable subsecond lengths properly' do
+-    @values.first.to_f.should be_within(0.00002).of(Time.at(1292452328, 493770).to_f)
++    expect(@values.first.to_f).to be_within(0.00002).of(Time.at(1292452328, 493770).to_f)
+     @reader.next!
+     @values = @reader.values
+-    @values.first.to_f.should be_within(0.00002).of(Time.at(1292452348, 942694).to_f)
++    expect(@values.first.to_f).to be_within(0.00002).of(Time.at(1292452348, 942694).to_f)
+   end
+ 
+ end
diff --git a/debian/patches/series b/debian/patches/series
index 6087ba4..766f334 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
 0030_deactivate_asynchronous_shared_spec.patch
+0040-require-its.patch
+0050-tests-support-rspec3.patch
+0060-lib-spec-support-rspec3.patch

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



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