marjoree 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +50 -0
- data/examples/contains_example.rb +23 -0
- data/examples/count_and_insert_example.rb +20 -0
- data/examples/select_example.rb +27 -0
- data/html/classes/ExpectedResultSet.html +220 -0
- data/html/classes/ExpectedResultSet.src/M000001.html +18 -0
- data/html/classes/ExpectedResultSet.src/M000002.html +18 -0
- data/html/classes/ExpectedResultSet.src/M000003.html +18 -0
- data/html/classes/ExpectedResultSet.src/M000004.html +18 -0
- data/html/classes/Marjoree.html +568 -0
- data/html/classes/Marjoree.src/M000022.html +19 -0
- data/html/classes/Marjoree.src/M000023.html +20 -0
- data/html/classes/Marjoree.src/M000024.html +22 -0
- data/html/classes/Marjoree.src/M000025.html +18 -0
- data/html/classes/Marjoree.src/M000026.html +20 -0
- data/html/classes/Marjoree.src/M000027.html +18 -0
- data/html/classes/Marjoree.src/M000028.html +18 -0
- data/html/classes/Marjoree.src/M000029.html +21 -0
- data/html/classes/Marjoree.src/M000030.html +20 -0
- data/html/classes/Marjoree.src/M000031.html +19 -0
- data/html/classes/Marjoree.src/M000032.html +18 -0
- data/html/classes/Marjoree.src/M000033.html +18 -0
- data/html/classes/Marjoree.src/M000034.html +19 -0
- data/html/classes/Marjoree.src/M000035.html +21 -0
- data/html/classes/Marjoree.src/M000036.html +26 -0
- data/html/classes/Marjoree.src/M000037.html +22 -0
- data/html/classes/Marjoree.src/M000038.html +23 -0
- data/html/classes/Marjoree.src/M000039.html +24 -0
- data/html/classes/Marjoree.src/M000040.html +18 -0
- data/html/classes/Marjoree.src/M000041.html +18 -0
- data/html/classes/Marjoree.src/M000042.html +25 -0
- data/html/classes/ODBC/Error.html +152 -0
- data/html/classes/ODBC/Error.src/M000020.html +21 -0
- data/html/classes/ODBC/Error.src/M000021.html +18 -0
- data/html/classes/ODBC/TimeStamp.html +182 -0
- data/html/classes/ODBC/TimeStamp.src/M000017.html +18 -0
- data/html/classes/ODBC/TimeStamp.src/M000018.html +22 -0
- data/html/classes/ODBC/TimeStamp.src/M000019.html +19 -0
- data/html/classes/ODBC.html +108 -0
- data/html/classes/ResultSetWrapper.html +345 -0
- data/html/classes/ResultSetWrapper.src/M000005.html +27 -0
- data/html/classes/ResultSetWrapper.src/M000006.html +24 -0
- data/html/classes/ResultSetWrapper.src/M000007.html +23 -0
- data/html/classes/ResultSetWrapper.src/M000008.html +18 -0
- data/html/classes/ResultSetWrapper.src/M000009.html +18 -0
- data/html/classes/ResultSetWrapper.src/M000010.html +18 -0
- data/html/classes/ResultSetWrapper.src/M000011.html +18 -0
- data/html/classes/ResultSetWrapper.src/M000012.html +20 -0
- data/html/classes/ResultSetWrapper.src/M000013.html +18 -0
- data/html/classes/ResultSetWrapper.src/M000014.html +22 -0
- data/html/classes/ResultSetWrapper.src/M000015.html +23 -0
- data/html/classes/ResultSetWrapper.src/M000016.html +27 -0
- data/html/created.rid +1 -0
- data/html/files/README.html +159 -0
- data/html/files/lib/expected_result_set_rb.html +116 -0
- data/html/files/lib/marjoree_rb.html +110 -0
- data/html/files/lib/odbc_overrides_rb.html +101 -0
- data/html/files/lib/result_set_wrapper_rb.html +101 -0
- data/html/fr_class_index.html +32 -0
- data/html/fr_file_index.html +31 -0
- data/html/fr_method_index.html +68 -0
- data/html/index.html +24 -0
- data/html/rdoc-style.css +208 -0
- data/lib/expected_result_set.rb +35 -0
- data/lib/marjoree.rb +344 -0
- data/lib/odbc_overrides.rb +33 -0
- data/lib/result_set_wrapper.rb +193 -0
- data/rakefile.rb +38 -0
- data/tests/all_tests.rb +15 -0
- data/tests/sprocs/test_error_sproc.sp +11 -0
- data/tests/sprocs/test_sproc.sp +5 -0
- data/tests/sprocs/test_sproc_with_mixed_params.sp +15 -0
- data/tests/sprocs/test_sproc_with_output_params.sp +10 -0
- data/tests/sprocs/test_sproc_with_params.sp +9 -0
- data/tests/sprocs/test_sproc_with_select_and_ops.sp +12 -0
- data/tests/test_contains.rb +27 -0
- data/tests/test_delete.rb +47 -0
- data/tests/test_expected_result_set.rb +40 -0
- data/tests/test_insert.rb +47 -0
- data/tests/test_marjoree.rb +91 -0
- data/tests/test_num_rows.rb +32 -0
- data/tests/test_result_set_wrapper.rb +162 -0
- data/tests/test_select.rb +30 -0
- data/tests/test_sproc.rb +99 -0
- data/tests/test_time_stamp.rb +52 -0
- data/tests/test_truncate.rb +31 -0
- data/tests/test_update.rb +56 -0
- metadata +137 -0
data/README
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Say 'Hello' to Marjoree at marjoree.rubyforge.org
|
|
2
|
+
|
|
3
|
+
Release 0.0.1
|
|
4
|
+
|
|
5
|
+
Details
|
|
6
|
+
|
|
7
|
+
Marjoree is a ruby library which has been created to provide easier access to a database.
|
|
8
|
+
The main driver behind the development of Marjoree was to allow easy unit testing, and more specifically test driven development, of stored procedures.
|
|
9
|
+
When combined with rUnit, Marjoree provides a suitable unit testing environment.
|
|
10
|
+
|
|
11
|
+
Currently the only db vendor that is supported is Sybase and was developed under Ruby v1.8.5
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Running Marjoree:
|
|
15
|
+
|
|
16
|
+
Marjoree uses ODBC to connect to a dataserver, therefore you need an (Sybase) ODBC connection setup.
|
|
17
|
+
* To set up and ODBC connection on Windows,
|
|
18
|
+
Go to 'Control Panel', 'Adminstrative Tool', and select 'Data Sources (ODBC)' and enter the appropriate details of your database.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Tests Suite:
|
|
22
|
+
|
|
23
|
+
First you will need to enter the ODBC details in marjoree\tests\all_tests.rb to allow Marjoree to connect to the dataserver.
|
|
24
|
+
|
|
25
|
+
To run the tests suite open a command prompt and move to the 'marjoree' dir and run
|
|
26
|
+
|
|
27
|
+
rake test
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
|
|
32
|
+
These can be found in marjoree\examples, again you will need to enter the ODBC connection details in each file you wish to run.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
Contacts:
|
|
36
|
+
|
|
37
|
+
Peter Aitken ( jiggypete@googlemail.com )
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Contributers:
|
|
41
|
+
|
|
42
|
+
Peter Aitken
|
|
43
|
+
Ian Davies
|
|
44
|
+
Angus 'Chopper' MacCuish
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'marjoree'
|
|
2
|
+
include Marjoree
|
|
3
|
+
|
|
4
|
+
connect('ODBC_DATASOURCE_NAME', 'USERNAME', 'PASSWORD' )
|
|
5
|
+
Kernel.at_exit { disconnect }
|
|
6
|
+
puts
|
|
7
|
+
|
|
8
|
+
execute "CREATE TABLE TEST_TABLE( id int NOT NULL, value int NOT NULL )"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
has_value = contains? 'TEST_TABLE', { :value => 10 }
|
|
12
|
+
puts "Intitally has value 10: #{has_value}"
|
|
13
|
+
|
|
14
|
+
puts "Inserting"
|
|
15
|
+
insert( 'TEST_TABLE', { :id => 0, :value => 10 } )
|
|
16
|
+
|
|
17
|
+
has_value = contains? 'TEST_TABLE', { :value => 10 }
|
|
18
|
+
puts "Has value 10: #{has_value}"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
execute "DROP TABLE TEST_TABLE"
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'marjoree'
|
|
2
|
+
include Marjoree
|
|
3
|
+
|
|
4
|
+
connect('ODBC_DATASOURCE_NAME', 'USERNAME', 'PASSWORD' )
|
|
5
|
+
Kernel.at_exit { disconnect }
|
|
6
|
+
puts
|
|
7
|
+
|
|
8
|
+
execute "CREATE TABLE TEST_TABLE( id int NOT NULL, value int NOT NULL )"
|
|
9
|
+
|
|
10
|
+
initial_count = count( 'TEST_TABLE' )
|
|
11
|
+
puts "Intial Count: #{initial_count}"
|
|
12
|
+
|
|
13
|
+
insert( 'TEST_TABLE', { :id => 0, :value => 10 } )
|
|
14
|
+
|
|
15
|
+
count_after_insert = count( 'TEST_TABLE' )
|
|
16
|
+
puts "Count after insert: #{count_after_insert}"
|
|
17
|
+
|
|
18
|
+
execute "DROP TABLE TEST_TABLE"
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require 'marjoree'
|
|
2
|
+
include Marjoree
|
|
3
|
+
|
|
4
|
+
connect('ODBC_DATASOURCE_NAME', 'USERNAME', 'PASSWORD' )
|
|
5
|
+
Kernel.at_exit { disconnect }
|
|
6
|
+
puts
|
|
7
|
+
|
|
8
|
+
execute "CREATE TABLE TEST_TABLE( id int NOT NULL, value int NOT NULL )"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
results = select( 'TEST_TABLE' )
|
|
13
|
+
puts "Initial Num result rows: #{results.count}"
|
|
14
|
+
|
|
15
|
+
insert( 'TEST_TABLE', { :id => 0, :value => 10 } )
|
|
16
|
+
results = select( 'TEST_TABLE' )
|
|
17
|
+
|
|
18
|
+
puts "Num result rows: #{results.count}"
|
|
19
|
+
puts results
|
|
20
|
+
|
|
21
|
+
insert( 'TEST_TABLE', { :id => 1, :value => 20 } )
|
|
22
|
+
results = select( 'TEST_TABLE' )
|
|
23
|
+
puts results
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
execute "DROP TABLE TEST_TABLE"
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: ExpectedResultSet</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">ExpectedResultSet</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/expected_result_set_rb.html">
|
|
59
|
+
lib/expected_result_set.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
Object
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
<div id="description">
|
|
82
|
+
<p>
|
|
83
|
+
A class, as the name suggests, to setup and expected result set.
|
|
84
|
+
</p>
|
|
85
|
+
<p>
|
|
86
|
+
Typical usage
|
|
87
|
+
</p>
|
|
88
|
+
<pre>
|
|
89
|
+
expected = ExpectedResultSet.new
|
|
90
|
+
expected.columns = ['first_column_name', 'second_column_name']
|
|
91
|
+
expected.rows << [ 'first item', 1 ]
|
|
92
|
+
expected.rows << [ 'second item', 2 ]
|
|
93
|
+
</pre>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div id="method-list">
|
|
101
|
+
<h3 class="section-bar">Methods</h3>
|
|
102
|
+
|
|
103
|
+
<div class="name-list">
|
|
104
|
+
<a href="#M000002">columns=</a>
|
|
105
|
+
<a href="#M000001">new</a>
|
|
106
|
+
<a href="#M000003">row_hash</a>
|
|
107
|
+
<a href="#M000004">row_hashes</a>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<!-- if includes -->
|
|
115
|
+
|
|
116
|
+
<div id="section">
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<div id="attribute-list">
|
|
123
|
+
<h3 class="section-bar">Attributes</h3>
|
|
124
|
+
|
|
125
|
+
<div class="name-list">
|
|
126
|
+
<table>
|
|
127
|
+
<tr class="top-aligned-row context-row">
|
|
128
|
+
<td class="context-item-name">columns</td>
|
|
129
|
+
<td class="context-item-value"> [R] </td>
|
|
130
|
+
<td class="context-item-desc"></td>
|
|
131
|
+
</tr>
|
|
132
|
+
<tr class="top-aligned-row context-row">
|
|
133
|
+
<td class="context-item-name">rows</td>
|
|
134
|
+
<td class="context-item-value"> [R] </td>
|
|
135
|
+
<td class="context-item-desc"></td>
|
|
136
|
+
</tr>
|
|
137
|
+
</table>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<!-- if method_list -->
|
|
144
|
+
<div id="methods">
|
|
145
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
146
|
+
|
|
147
|
+
<div id="method-M000001" class="method-detail">
|
|
148
|
+
<a name="M000001"></a>
|
|
149
|
+
|
|
150
|
+
<div class="method-heading">
|
|
151
|
+
<a href="ExpectedResultSet.src/M000001.html" target="Code" class="method-signature"
|
|
152
|
+
onclick="popupCode('ExpectedResultSet.src/M000001.html');return false;">
|
|
153
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
|
154
|
+
</a>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="method-description">
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
162
|
+
|
|
163
|
+
<div id="method-M000002" class="method-detail">
|
|
164
|
+
<a name="M000002"></a>
|
|
165
|
+
|
|
166
|
+
<div class="method-heading">
|
|
167
|
+
<a href="ExpectedResultSet.src/M000002.html" target="Code" class="method-signature"
|
|
168
|
+
onclick="popupCode('ExpectedResultSet.src/M000002.html');return false;">
|
|
169
|
+
<span class="method-name">columns=</span><span class="method-args">(value)</span>
|
|
170
|
+
</a>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div class="method-description">
|
|
174
|
+
<p>
|
|
175
|
+
columns should be given an array of strings.
|
|
176
|
+
</p>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div id="method-M000003" class="method-detail">
|
|
181
|
+
<a name="M000003"></a>
|
|
182
|
+
|
|
183
|
+
<div class="method-heading">
|
|
184
|
+
<a href="ExpectedResultSet.src/M000003.html" target="Code" class="method-signature"
|
|
185
|
+
onclick="popupCode('ExpectedResultSet.src/M000003.html');return false;">
|
|
186
|
+
<span class="method-name">row_hash</span><span class="method-args">(index)</span>
|
|
187
|
+
</a>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div class="method-description">
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div id="method-M000004" class="method-detail">
|
|
195
|
+
<a name="M000004"></a>
|
|
196
|
+
|
|
197
|
+
<div class="method-heading">
|
|
198
|
+
<a href="ExpectedResultSet.src/M000004.html" target="Code" class="method-signature"
|
|
199
|
+
onclick="popupCode('ExpectedResultSet.src/M000004.html');return false;">
|
|
200
|
+
<span class="method-name">row_hashes</span><span class="method-args">()</span>
|
|
201
|
+
</a>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<div class="method-description">
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<div id="validator-badges">
|
|
216
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
</body>
|
|
220
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>new (ExpectedResultSet)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/expected_result_set.rb, line 11</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
|
15
|
+
<span class="ruby-ivar">@rows</span> = []
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>columns= (ExpectedResultSet)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/expected_result_set.rb, line 16</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">columns=</span>(<span class="ruby-identifier">value</span>)
|
|
15
|
+
<span class="ruby-ivar">@columns</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">to_s</span>}
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>row_hash (ExpectedResultSet)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/expected_result_set.rb, line 20</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">row_hash</span>(<span class="ruby-identifier">index</span>)
|
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_hash</span>( <span class="ruby-ivar">@rows</span>[<span class="ruby-identifier">index</span>] )
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>row_hashes (ExpectedResultSet)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/expected_result_set.rb, line 24</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">row_hashes</span>
|
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rows</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span> <span class="ruby-identifier">to_hash</span>(<span class="ruby-identifier">row</span>) }
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|