|
49 | 49 | plsql.test_package.varchar2_default3.should == 'default'
|
50 | 50 | end
|
51 | 51 |
|
52 |
| - it "should set and get VARCHAR2(n CHAR) variable" do |
53 |
| - if OCI8.properties.has_key?(:length_semantics) |
54 |
| - original_length_semantics = OCI8.properties[:length_semantics] |
55 |
| - OCI8.properties[:length_semantics] = :char |
| 52 | + describe "with character or byte limit" do |
| 53 | + before(:each) do |
| 54 | + if !defined?(JRUBY_VERSION) && OCI8.properties.has_key?(:length_semantics) |
| 55 | + @original_length_semantics = OCI8.properties[:length_semantics] |
| 56 | + OCI8.properties[:length_semantics] = :char |
| 57 | + end |
| 58 | + end |
| 59 | + |
| 60 | + after(:each) do |
| 61 | + if !defined?(JRUBY_VERSION) && OCI8.properties.has_key?(:length_semantics) |
| 62 | + OCI8.properties[:length_semantics] = @original_length_semantics |
| 63 | + end |
56 | 64 | end
|
57 |
| - plsql.test_package.varchar2_3_char = 'āčē' |
58 |
| - plsql.test_package.varchar2_3_char.should == 'āčē' |
59 |
| - lambda { plsql.test_package.varchar2_3_char = 'aceg' }.should raise_error(/buffer too small/) |
60 |
| - OCI8.properties[:length_semantics] = original_length_semantics if OCI8.properties.has_key?(:length_semantics) |
61 |
| - end |
62 | 65 |
|
63 |
| - it "should set and get VARCHAR2(n BYTE) variable" do |
64 |
| - if OCI8.properties.has_key?(:length_semantics) |
65 |
| - original_length_semantics = OCI8.properties[:length_semantics] |
66 |
| - OCI8.properties[:length_semantics] = :char |
| 66 | + it "should set and get VARCHAR2(n CHAR) variable" do |
| 67 | + plsql.test_package.varchar2_3_char = 'āčē' |
| 68 | + plsql.test_package.varchar2_3_char.should == 'āčē' |
| 69 | + lambda { plsql.test_package.varchar2_3_char = 'aceg' }.should raise_error(/buffer too small/) |
67 | 70 | end
|
68 |
| - plsql.test_package.varchar2_3_byte = 'ace' |
69 |
| - plsql.test_package.varchar2_3_byte.should == 'ace' |
70 |
| - lambda { plsql.test_package.varchar2_3_byte = 'āce' }.should raise_error(/buffer too small/) |
71 |
| - lambda { plsql.test_package.varchar2_3_byte = 'aceg' }.should raise_error(/buffer too small/) |
72 |
| - OCI8.properties[:length_semantics] = original_length_semantics if OCI8.properties.has_key?(:length_semantics) |
| 71 | + |
| 72 | + it "should set and get VARCHAR2(n BYTE) variable" do |
| 73 | + plsql.test_package.varchar2_3_byte = 'ace' |
| 74 | + plsql.test_package.varchar2_3_byte.should == 'ace' |
| 75 | + lambda { plsql.test_package.varchar2_3_byte = 'āce' }.should raise_error(/buffer too small/) |
| 76 | + lambda { plsql.test_package.varchar2_3_byte = 'aceg' }.should raise_error(/buffer too small/) |
| 77 | + end |
| 78 | + |
73 | 79 | end
|
74 | 80 |
|
75 | 81 | it "should set and get CHAR variable" do
|
|
0 commit comments