graffle 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/History.txt +5 -0
  2. data/Manifest.txt +22 -11
  3. data/README.txt +2 -2
  4. data/Rakefile.hoe +2 -1
  5. data/design-notes/graphical-tests-for-rails-objects.graffle +644 -0
  6. data/examples/objects with notes.expected +5 -0
  7. data/examples/objects with notes.graffle +338 -0
  8. data/examples/objects with notes.rb +42 -0
  9. data/examples/rails-workflow-test.expected +1 -1
  10. data/examples/rails-workflow-test.graffle/data.plist +86 -7
  11. data/examples/rails-workflow-test.rb +11 -9
  12. data/graffle.tmproj +82 -190
  13. data/lib/graffle.rb +19 -2
  14. data/lib/graffle/point.rb +1 -2
  15. data/lib/graffle/stereotypes.rb +62 -16
  16. data/lib/graffle/version.rb +1 -1
  17. data/lib/graphical_tests_for_rails.rb +8 -5
  18. data/lib/graphical_tests_for_rails/graphic-volunteers.rb +75 -0
  19. data/lib/graphical_tests_for_rails/orderings.rb +90 -84
  20. data/lib/graphical_tests_for_rails/picture-appliers.rb +225 -0
  21. data/lib/graphical_tests_for_rails/text-appliers.rb +135 -0
  22. data/lib/graphical_tests_for_rails/volunteer-pool.rb +115 -0
  23. data/test/abstract-graphic-tests.rb +48 -0
  24. data/test/document-tests.rb +5 -5
  25. data/test/examples-tests.rb +42 -0
  26. data/test/graphical_tests_for_rails/{graphic-interpreter-tests.rb → deprecated-graphic-interpreter-tests.rb} +11 -21
  27. data/test/graphical_tests_for_rails/graphic-volunteer-tests.rb +218 -0
  28. data/test/graphical_tests_for_rails/in-workflow-order-tests.rb +1 -1
  29. data/test/graphical_tests_for_rails/picture-applier-tests.rb +215 -0
  30. data/test/graphical_tests_for_rails/{text-interpreter-tests.rb → text-applier-tests.rb} +17 -3
  31. data/test/graphical_tests_for_rails/util.rb +16 -0
  32. data/test/line-graphic-tests.rb +9 -1
  33. data/test/note-tests.rb +62 -0
  34. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/data.plist +0 -0
  35. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image1.png +0 -0
  36. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image2.png +0 -0
  37. data/test/{graffle-file-types → sample-files}/as-a-package.graffle/image3.png +0 -0
  38. data/test/{graffle-file-types → sample-files}/multiple-canvases.graffle +0 -0
  39. data/test/{graffle-file-types → sample-files}/opening-tests.rb +9 -4
  40. data/test/{graffle-file-types → sample-files}/two-boxes-and-a-line.graffle +0 -0
  41. data/test/shaped-graphic-tests.rb +2 -3
  42. metadata +42 -18
  43. data/lib/graphical_tests_for_rails/interpreters.rb +0 -147
  44. data/test/tests-of-examples/workflow-slowtests.rb +0 -19
@@ -0,0 +1,5 @@
1
+ The box's content: "graphic object with notes"
2
+ The box's note: "graphic object note"
3
+ The line's label: "both line and label have notes"
4
+ The line's note: "line graphic note"
5
+ The line's label's note as line array: ["line", "label", "note"]
@@ -0,0 +1,338 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>ActiveLayerIndex</key>
6
+ <integer>0</integer>
7
+ <key>AutoAdjust</key>
8
+ <true/>
9
+ <key>CanvasColor</key>
10
+ <dict>
11
+ <key>w</key>
12
+ <string>1</string>
13
+ </dict>
14
+ <key>CanvasOrigin</key>
15
+ <string>{0, 0}</string>
16
+ <key>CanvasScale</key>
17
+ <real>1</real>
18
+ <key>ColumnAlign</key>
19
+ <integer>1</integer>
20
+ <key>ColumnSpacing</key>
21
+ <real>36</real>
22
+ <key>CreationDate</key>
23
+ <string>2007-07-19 13:24:39 -0500</string>
24
+ <key>Creator</key>
25
+ <string>Brian Marick</string>
26
+ <key>DisplayScale</key>
27
+ <string>1 in = 1 in</string>
28
+ <key>GraphDocumentVersion</key>
29
+ <integer>5</integer>
30
+ <key>GraphicsList</key>
31
+ <array>
32
+ <dict>
33
+ <key>Bounds</key>
34
+ <string>{{215.286, 215.486}, {170, 14}}</string>
35
+ <key>Class</key>
36
+ <string>ShapedGraphic</string>
37
+ <key>FitText</key>
38
+ <string>YES</string>
39
+ <key>FontInfo</key>
40
+ <dict>
41
+ <key>Color</key>
42
+ <dict>
43
+ <key>w</key>
44
+ <string>0</string>
45
+ </dict>
46
+ <key>Font</key>
47
+ <string>Helvetica</string>
48
+ <key>Size</key>
49
+ <real>12</real>
50
+ </dict>
51
+ <key>ID</key>
52
+ <integer>194</integer>
53
+ <key>Line</key>
54
+ <dict>
55
+ <key>ID</key>
56
+ <integer>193</integer>
57
+ <key>Position</key>
58
+ <real>0.2723330557346344</real>
59
+ <key>RotationType</key>
60
+ <integer>0</integer>
61
+ </dict>
62
+ <key>Notes</key>
63
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
64
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
65
+ {\colortbl;\red255\green255\blue255;}
66
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
67
+
68
+ \f0\fs24 \cf0 line\
69
+ label\
70
+ note}</string>
71
+ <key>Shape</key>
72
+ <string>Rectangle</string>
73
+ <key>Style</key>
74
+ <dict>
75
+ <key>shadow</key>
76
+ <dict>
77
+ <key>Draws</key>
78
+ <string>NO</string>
79
+ </dict>
80
+ <key>stroke</key>
81
+ <dict>
82
+ <key>Draws</key>
83
+ <string>NO</string>
84
+ </dict>
85
+ </dict>
86
+ <key>Text</key>
87
+ <dict>
88
+ <key>Text</key>
89
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
90
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
91
+ {\colortbl;\red255\green255\blue255;}
92
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
93
+
94
+ \f0\fs24 \cf0 both line and label have notes}</string>
95
+ </dict>
96
+ </dict>
97
+ <dict>
98
+ <key>Class</key>
99
+ <string>LineGraphic</string>
100
+ <key>ID</key>
101
+ <integer>193</integer>
102
+ <key>Notes</key>
103
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
104
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
105
+ {\colortbl;\red255\green255\blue255;}
106
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
107
+
108
+ \f0\fs24 \cf0 line graphic note}</string>
109
+ <key>Points</key>
110
+ <array>
111
+ <string>{131, 265}</string>
112
+ <string>{467, 200}</string>
113
+ <string>{410, 391}</string>
114
+ </array>
115
+ <key>Style</key>
116
+ <dict>
117
+ <key>stroke</key>
118
+ <dict>
119
+ <key>HeadArrow</key>
120
+ <string>FilledArrow</string>
121
+ <key>LineType</key>
122
+ <integer>1</integer>
123
+ <key>TailArrow</key>
124
+ <string>0</string>
125
+ </dict>
126
+ </dict>
127
+ </dict>
128
+ <dict>
129
+ <key>Bounds</key>
130
+ <string>{{109, 71}, {160, 93}}</string>
131
+ <key>Class</key>
132
+ <string>ShapedGraphic</string>
133
+ <key>ID</key>
134
+ <integer>2</integer>
135
+ <key>Notes</key>
136
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
137
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
138
+ {\colortbl;\red255\green255\blue255;}
139
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
140
+
141
+ \f0\fs24 \cf0 graphic object note}</string>
142
+ <key>Shape</key>
143
+ <string>Rectangle</string>
144
+ <key>Text</key>
145
+ <dict>
146
+ <key>Text</key>
147
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
148
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
149
+ {\colortbl;\red255\green255\blue255;}
150
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
151
+
152
+ \f0\fs24 \cf0 graphic object with notes}</string>
153
+ </dict>
154
+ </dict>
155
+ </array>
156
+ <key>GridInfo</key>
157
+ <dict/>
158
+ <key>GuidesLocked</key>
159
+ <string>NO</string>
160
+ <key>GuidesVisible</key>
161
+ <string>YES</string>
162
+ <key>HPages</key>
163
+ <integer>1</integer>
164
+ <key>ImageCounter</key>
165
+ <integer>1</integer>
166
+ <key>IsPalette</key>
167
+ <string>NO</string>
168
+ <key>KeepToScale</key>
169
+ <false/>
170
+ <key>Layers</key>
171
+ <array>
172
+ <dict>
173
+ <key>Lock</key>
174
+ <string>NO</string>
175
+ <key>Name</key>
176
+ <string>Layer 1</string>
177
+ <key>Print</key>
178
+ <string>YES</string>
179
+ <key>View</key>
180
+ <string>YES</string>
181
+ </dict>
182
+ </array>
183
+ <key>LayoutInfo</key>
184
+ <dict/>
185
+ <key>LinksVisible</key>
186
+ <string>NO</string>
187
+ <key>MagnetsVisible</key>
188
+ <string>NO</string>
189
+ <key>MasterSheet</key>
190
+ <string>Master 1</string>
191
+ <key>MasterSheets</key>
192
+ <array>
193
+ <dict>
194
+ <key>ActiveLayerIndex</key>
195
+ <integer>0</integer>
196
+ <key>AutoAdjust</key>
197
+ <true/>
198
+ <key>CanvasColor</key>
199
+ <dict>
200
+ <key>w</key>
201
+ <string>1</string>
202
+ </dict>
203
+ <key>CanvasOrigin</key>
204
+ <string>{0, 0}</string>
205
+ <key>CanvasScale</key>
206
+ <real>1</real>
207
+ <key>ColumnAlign</key>
208
+ <integer>1</integer>
209
+ <key>ColumnSpacing</key>
210
+ <real>36</real>
211
+ <key>DisplayScale</key>
212
+ <string>1 in = 1 in</string>
213
+ <key>GraphicsList</key>
214
+ <array/>
215
+ <key>GridInfo</key>
216
+ <dict/>
217
+ <key>HPages</key>
218
+ <integer>1</integer>
219
+ <key>IsPalette</key>
220
+ <string>NO</string>
221
+ <key>KeepToScale</key>
222
+ <false/>
223
+ <key>Layers</key>
224
+ <array>
225
+ <dict>
226
+ <key>Lock</key>
227
+ <string>NO</string>
228
+ <key>Name</key>
229
+ <string>Layer 1</string>
230
+ <key>Print</key>
231
+ <string>YES</string>
232
+ <key>View</key>
233
+ <string>YES</string>
234
+ </dict>
235
+ </array>
236
+ <key>LayoutInfo</key>
237
+ <dict/>
238
+ <key>Orientation</key>
239
+ <integer>2</integer>
240
+ <key>OutlineStyle</key>
241
+ <string>Basic</string>
242
+ <key>RowAlign</key>
243
+ <integer>1</integer>
244
+ <key>RowSpacing</key>
245
+ <real>36</real>
246
+ <key>SheetTitle</key>
247
+ <string>Master 1</string>
248
+ <key>UniqueID</key>
249
+ <integer>1</integer>
250
+ <key>VPages</key>
251
+ <integer>1</integer>
252
+ </dict>
253
+ </array>
254
+ <key>ModificationDate</key>
255
+ <string>2007-07-19 13:27:11 -0500</string>
256
+ <key>Modifier</key>
257
+ <string>Brian Marick</string>
258
+ <key>NotesVisible</key>
259
+ <string>NO</string>
260
+ <key>Orientation</key>
261
+ <integer>2</integer>
262
+ <key>OriginVisible</key>
263
+ <string>NO</string>
264
+ <key>OutlineStyle</key>
265
+ <string>Basic</string>
266
+ <key>PageBreaks</key>
267
+ <string>YES</string>
268
+ <key>PrintInfo</key>
269
+ <dict>
270
+ <key>NSBottomMargin</key>
271
+ <array>
272
+ <string>float</string>
273
+ <string>0</string>
274
+ </array>
275
+ <key>NSLeftMargin</key>
276
+ <array>
277
+ <string>float</string>
278
+ <string>0</string>
279
+ </array>
280
+ <key>NSPaperSize</key>
281
+ <array>
282
+ <string>size</string>
283
+ <string>{612, 792}</string>
284
+ </array>
285
+ <key>NSRightMargin</key>
286
+ <array>
287
+ <string>float</string>
288
+ <string>0</string>
289
+ </array>
290
+ <key>NSTopMargin</key>
291
+ <array>
292
+ <string>float</string>
293
+ <string>0</string>
294
+ </array>
295
+ </dict>
296
+ <key>ReadOnly</key>
297
+ <string>NO</string>
298
+ <key>RowAlign</key>
299
+ <integer>1</integer>
300
+ <key>RowSpacing</key>
301
+ <real>36</real>
302
+ <key>SheetTitle</key>
303
+ <string>Canvas 1</string>
304
+ <key>SmartAlignmentGuidesActive</key>
305
+ <string>YES</string>
306
+ <key>SmartDistanceGuidesActive</key>
307
+ <string>YES</string>
308
+ <key>UniqueID</key>
309
+ <integer>1</integer>
310
+ <key>UseEntirePage</key>
311
+ <true/>
312
+ <key>VPages</key>
313
+ <integer>1</integer>
314
+ <key>WindowInfo</key>
315
+ <dict>
316
+ <key>CurrentSheet</key>
317
+ <string>0</string>
318
+ <key>DrawerOpen</key>
319
+ <false/>
320
+ <key>DrawerTab</key>
321
+ <string>Outline</string>
322
+ <key>DrawerWidth</key>
323
+ <real>209</real>
324
+ <key>FitInWindow</key>
325
+ <false/>
326
+ <key>Frame</key>
327
+ <string>{{112, 0}, {594, 746}}</string>
328
+ <key>ShowRuler</key>
329
+ <false/>
330
+ <key>ShowStatusBar</key>
331
+ <true/>
332
+ <key>VisibleRegion</key>
333
+ <string>{{0, 0}, {579, 632}}</string>
334
+ <key>Zoom</key>
335
+ <string>1</string>
336
+ </dict>
337
+ </dict>
338
+ </plist>
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Brian Marick on 2007-07-19.
4
+ # Copyright (c) 2007. All rights reserved.
5
+ ### The following adjusts the load path so that the correct version of
6
+ ### a library is found, no matter where the script is run from.
7
+ require 'pathname'
8
+ $:.unshift((Pathname.new(__FILE__).parent.parent + 'lib').to_s)
9
+ require 's4t-utils/load-path-auto-adjuster'
10
+
11
+ require 's4t-utils'
12
+ include S4tUtils
13
+
14
+ require 'graphical_tests_for_rails'
15
+ include GraphicalTestsForRails
16
+
17
+
18
+
19
+ if $0 == __FILE__
20
+ with_pleasant_exceptions do
21
+ testfile = File.dirname(__FILE__) + '/objects with notes.graffle'
22
+ doc = Graffle.parse_file(testfile)
23
+
24
+ # Labels are top-level objects, along with the object they
25
+ # label. To preserve the illusion they're attached to the
26
+ # object, let's not include them.
27
+ graphics = doc.first_sheet.graphics_without_labels
28
+
29
+ # The origin for a line is the point from which it was drawn.
30
+ # For a shaped graphic like a box, it's the upper left corner of the
31
+ # bounding box.
32
+ sorted = graphics.sort_by {|g| g.origin}
33
+ box = sorted[0]
34
+ pi box.content.as_plain_text, "The box's content"
35
+ pi box.note.as_plain_text, "The box's note"
36
+
37
+ line = sorted[1]
38
+ pi line.label.content.as_plain_text, "The line's label"
39
+ pi line.note.as_plain_text, "The line's note"
40
+ pi line.label.note.as_lines, "The line's label's note as line array"
41
+ end
42
+ end
@@ -3,7 +3,7 @@ john_follows("sign up")
3
3
  assert_on_page("signup")
4
4
  john_signs_up_as("john", "john@example.com", "sloop")
5
5
  assert_on_page("welcome")
6
- john_waits_for_activation_email()
6
+ waits_for_activation_email("john")
7
7
  john_clicks_on_url_ending_in_activation_code()
8
8
  assert_on_page("login")
9
9
  john_logs_in_as("john", "sloop")
@@ -31,7 +31,86 @@
31
31
  <array>
32
32
  <dict>
33
33
  <key>Bounds</key>
34
- <string>{{204.628, 538.581}, {169, 24}}</string>
34
+ <string>{{242, 37}, {266, 14}}</string>
35
+ <key>Class</key>
36
+ <string>ShapedGraphic</string>
37
+ <key>FitText</key>
38
+ <string>Vertical</string>
39
+ <key>Flow</key>
40
+ <string>Resize</string>
41
+ <key>FontInfo</key>
42
+ <dict>
43
+ <key>Color</key>
44
+ <dict>
45
+ <key>w</key>
46
+ <string>0</string>
47
+ </dict>
48
+ <key>Font</key>
49
+ <string>Helvetica</string>
50
+ <key>Size</key>
51
+ <real>12</real>
52
+ </dict>
53
+ <key>ID</key>
54
+ <integer>207</integer>
55
+ <key>Notes</key>
56
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
57
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
58
+ {\colortbl;\red255\green255\blue255;}
59
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
60
+
61
+ \f0\fs24 \cf0 ignore}</string>
62
+ <key>Shape</key>
63
+ <string>Rectangle</string>
64
+ <key>Style</key>
65
+ <dict>
66
+ <key>fill</key>
67
+ <dict>
68
+ <key>Color</key>
69
+ <dict>
70
+ <key>b</key>
71
+ <string>0.901961</string>
72
+ <key>g</key>
73
+ <string>0.901961</string>
74
+ <key>r</key>
75
+ <string>0.901961</string>
76
+ </dict>
77
+ <key>Draws</key>
78
+ <string>NO</string>
79
+ </dict>
80
+ <key>shadow</key>
81
+ <dict>
82
+ <key>Draws</key>
83
+ <string>NO</string>
84
+ </dict>
85
+ <key>stroke</key>
86
+ <dict>
87
+ <key>Color</key>
88
+ <dict>
89
+ <key>b</key>
90
+ <string>0.592391</string>
91
+ <key>g</key>
92
+ <string>0.592391</string>
93
+ <key>r</key>
94
+ <string>0.592391</string>
95
+ </dict>
96
+ <key>Draws</key>
97
+ <string>NO</string>
98
+ </dict>
99
+ </dict>
100
+ <key>Text</key>
101
+ <dict>
102
+ <key>Text</key>
103
+ <string>{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
104
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
105
+ {\colortbl;\red255\green255\blue255;}
106
+ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
107
+
108
+ \f0\fs24 \cf0 THIS IS IGNORED BECAUSE OF NOTE}</string>
109
+ </dict>
110
+ </dict>
111
+ <dict>
112
+ <key>Bounds</key>
113
+ <string>{{204.628, 538.582}, {169, 24}}</string>
35
114
  <key>Class</key>
36
115
  <string>ShapedGraphic</string>
37
116
  <key>FitText</key>
@@ -89,7 +168,7 @@
89
168
  </dict>
90
169
  <dict>
91
170
  <key>Bounds</key>
92
- <string>{{169.07, 218.138}, {387, 14}}</string>
171
+ <string>{{169.07, 218.137}, {387, 14}}</string>
93
172
  <key>Class</key>
94
173
  <string>ShapedGraphic</string>
95
174
  <key>FitText</key>
@@ -147,7 +226,7 @@
147
226
  </dict>
148
227
  <dict>
149
228
  <key>Bounds</key>
150
- <string>{{28.785, 30.4289}, {127, 14}}</string>
229
+ <string>{{28.7849, 30.4289}, {127, 14}}</string>
151
230
  <key>Class</key>
152
231
  <string>ShapedGraphic</string>
153
232
  <key>FitText</key>
@@ -278,7 +357,7 @@
278
357
  <array>
279
358
  <string>{377, 495.428}</string>
280
359
  <string>{300.369, 512}</string>
281
- <string>{286.198, 589.218}</string>
360
+ <string>{286.199, 589.218}</string>
282
361
  </array>
283
362
  <key>Style</key>
284
363
  <dict>
@@ -790,7 +869,7 @@ active: no}</string>
790
869
  <string>{31.3693, 50}</string>
791
870
  <string>{97.3693, 51}</string>
792
871
  <string>{116.369, 62}</string>
793
- <string>{118.559, 85.5}</string>
872
+ <string>{118.558, 85.5}</string>
794
873
  </array>
795
874
  <key>Style</key>
796
875
  <dict>
@@ -947,7 +1026,7 @@ active: no}</string>
947
1026
  </dict>
948
1027
  </array>
949
1028
  <key>ModificationDate</key>
950
- <string>2007-07-12 15:17:38 -0500</string>
1029
+ <string>2007-07-21 03:45:52 -0500</string>
951
1030
  <key>Modifier</key>
952
1031
  <string>Brian Marick</string>
953
1032
  <key>NotesVisible</key>
@@ -1025,7 +1104,7 @@ active: no}</string>
1025
1104
  <key>ShowStatusBar</key>
1026
1105
  <true/>
1027
1106
  <key>VisibleRegion</key>
1028
- <string>{{0, 74}, {579, 632}}</string>
1107
+ <string>{{0, 0}, {579, 632}}</string>
1029
1108
  <key>Zoom</key>
1030
1109
  <string>1</string>
1031
1110
  </dict>