Created
November 13, 2009 10:46
-
-
Save myabc/233747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/data_objects/lib/data_objects/spec/typecast/string_spec.rb b/data_objects/lib/data_objects/spec/typecast/string_spec.rb | |
index 4b15afb..f06ef2c 100644 | |
--- a/data_objects/lib/data_objects/spec/typecast/string_spec.rb | |
+++ b/data_objects/lib/data_objects/spec/typecast/string_spec.rb | |
@@ -83,4 +83,25 @@ share_examples_for 'supporting String' do | |
end | |
+ class StringWithExtraPowers < String; end | |
+ | |
+ describe 'writing a kind of (subclass of) String' do | |
+ | |
+ before do | |
+ @reader = @connection.create_command("SELECT id FROM widgets WHERE id = ?").execute_reader(StringWithExtraPowers.new("2")) | |
+ @reader.next! | |
+ @values = @reader.values | |
+ end | |
+ | |
+ after do | |
+ @reader.close | |
+ end | |
+ | |
+ 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 } | |
+ end | |
+ | |
+ end | |
+ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment