microstation 0.4.1 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +23 -23
  3. data/.rspec +2 -2
  4. data/Gemfile +29 -10
  5. data/History.txt +6 -6
  6. data/LICENSE.adoc +22 -0
  7. data/Manifest.txt +91 -60
  8. data/README.adoc +131 -0
  9. data/Rakefile +72 -30
  10. data/bin/dgn2pdf +36 -37
  11. data/bin/dgn_template +107 -0
  12. data/bin/pw_print +35 -0
  13. data/cad_files/drawing_faatitle_in_non_default_model.dgn +0 -0
  14. data/cad_files/drawing_no_block.dgn +0 -0
  15. data/cad_files/drawing_with_3_block.dgn +0 -0
  16. data/cad_files/drawing_with_block.dgn +0 -0
  17. data/cad_files/drawing_with_text.dgn +0 -0
  18. data/cad_files/seed2d.dgn +0 -0
  19. data/cad_files/seed3d.dgn +0 -0
  20. data/lib/microstation/app.rb +781 -286
  21. data/lib/microstation/cad_input_queue.rb +100 -25
  22. data/lib/microstation/cell.rb +191 -0
  23. data/lib/microstation/changer.rb +70 -0
  24. data/lib/microstation/configuration.rb +193 -57
  25. data/lib/microstation/criteria_creation_t.rb +23 -0
  26. data/lib/microstation/dir.rb +252 -252
  27. data/lib/microstation/directory.rb +46 -0
  28. data/lib/microstation/drawing.rb +686 -189
  29. data/lib/microstation/element.rb +311 -0
  30. data/lib/microstation/enumerator.rb +32 -29
  31. data/lib/microstation/errors.rb +17 -0
  32. data/lib/microstation/event_handler.rb +28 -0
  33. data/lib/microstation/ext/pathname.rb +23 -25
  34. data/lib/microstation/ext/win32ole.rb +7 -0
  35. data/lib/microstation/extensions/faa.rb +124 -0
  36. data/lib/microstation/file_tests.rb +68 -0
  37. data/lib/microstation/functions.rb +60 -0
  38. data/lib/microstation/graphics.rb +35 -0
  39. data/lib/microstation/line.rb +19 -0
  40. data/lib/microstation/model.rb +45 -0
  41. data/lib/microstation/model_trait.rb +189 -0
  42. data/lib/microstation/ole_cad_input_message.rb +101 -0
  43. data/lib/microstation/ole_helper.rb +152 -0
  44. data/lib/microstation/pdf_support.rb +40 -40
  45. data/lib/microstation/point3d.rb +71 -0
  46. data/lib/microstation/primitive_command_interface.rb +66 -0
  47. data/lib/microstation/properties.rb +61 -57
  48. data/lib/microstation/property_handler.rb +48 -0
  49. data/lib/microstation/scan/color.rb +38 -38
  50. data/lib/microstation/scan/criteria.rb +89 -85
  51. data/lib/microstation/scan/klass.rb +43 -43
  52. data/lib/microstation/scan/level.rb +38 -38
  53. data/lib/microstation/scan/line_style.rb +45 -45
  54. data/lib/microstation/scan/line_weight.rb +33 -33
  55. data/lib/microstation/scan/range.rb +19 -0
  56. data/lib/microstation/scan/scan_trait.rb +51 -0
  57. data/lib/microstation/scan/subtype.rb +40 -40
  58. data/lib/microstation/scan/type.rb +134 -109
  59. data/lib/microstation/scan_trait.rb +62 -0
  60. data/lib/microstation/scanner.rb +24 -24
  61. data/lib/microstation/tag.rb +87 -58
  62. data/lib/microstation/tag_set.rb +385 -280
  63. data/lib/microstation/tag_set_trait.rb +51 -0
  64. data/lib/microstation/tagged_element.rb +105 -0
  65. data/lib/microstation/template.rb +90 -84
  66. data/lib/microstation/template_info.rb +172 -0
  67. data/lib/microstation/template_runner.rb +65 -0
  68. data/lib/microstation/text.rb +79 -54
  69. data/lib/microstation/text_node.rb +124 -74
  70. data/lib/microstation/ts/attribute.rb +140 -139
  71. data/lib/microstation/ts/instance.rb +146 -112
  72. data/lib/microstation/ts/tagset_trait.rb +49 -0
  73. data/lib/microstation/types.rb +91 -91
  74. data/lib/microstation/version.rb +5 -0
  75. data/lib/microstation/wrap.rb +28 -214
  76. data/lib/microstation.rb +252 -88
  77. data/plot/pdf-bw.plt +164 -164
  78. data/plot/pdf.plt +163 -163
  79. data/plot/png.plt +383 -383
  80. data/plot/tiff.plt +384 -384
  81. data/plot/wmbw.tbl +324 -66
  82. data/plot/wmcolor.tbl +62 -62
  83. data/spec/microstation/app_spec.rb +184 -0
  84. data/spec/microstation/configuration_spec.rb +131 -0
  85. data/spec/microstation/drawing_spec.rb +245 -0
  86. data/spec/microstation/functions_spec.rb +36 -0
  87. data/spec/microstation/tag_set_spec.rb +159 -0
  88. data/spec/microstation/template_spec.rb +159 -0
  89. data/spec/microstation/text_node_spec.rb +67 -0
  90. data/spec/microstation/text_spec.rb +42 -0
  91. data/spec/microstation_spec.rb +47 -36
  92. data/spec/spec_helper.rb +97 -31
  93. metadata +308 -84
  94. data/.gemtest +0 -0
  95. data/README.txt +0 -75
  96. data/lib/microstation/attributes.rb +0 -35
  97. data/lib/microstation/extensions/hash.rb +0 -27
  98. data/spec/app_spec.rb +0 -267
  99. data/spec/configuration_spec.rb +0 -122
  100. data/spec/drawing_spec.rb +0 -247
  101. data/spec/drawings/new_drawing.dgn +0 -0
  102. data/spec/drawings/test.dgn +0 -0
  103. data/spec/drawings/test1.dgn +0 -0
  104. data/spec/drawings/testfile.pdf +0 -0
  105. data/spec/enumerator_spec.rb +0 -60
  106. data/spec/scanner_spec.rb +0 -155
  107. data/spec/spec_app.rb +0 -11
  108. data/spec/tag_set_spec.rb +0 -123
  109. data/spec/text_node_spec.rb +0 -92
  110. data/spec/text_spec.rb +0 -62
data/spec/app_spec.rb DELETED
@@ -1,267 +0,0 @@
1
- require File.join(File.dirname(__FILE__) , 'spec_helper')
2
-
3
- describe "Microstation::App" do
4
-
5
- before(:all) do
6
- @app = Microstation::App.new
7
- @existing_drawing_path = drawing_path('test.dgn')
8
- @new_drawing_path = drawing_path('my_new_drawing.dgn')
9
- end
10
-
11
- before(:each) do
12
- File.delete(@new_drawing_path) if File.exist?(@new_drawing_path)
13
- end
14
-
15
-
16
- after(:all) do
17
- @app.quit if @app
18
- @app = nil
19
- end
20
-
21
- let(:app){@app}
22
-
23
- describe "#initialize" do
24
- it "with no options visible is true" do
25
- app = Microstation::App.new
26
- app.should be_visible
27
- end
28
-
29
- it "works with options" do
30
- app = Microstation::App.new(:visible => false)
31
- app.should_not be_visible
32
- end
33
-
34
- end
35
-
36
- describe "#can_open?" do
37
-
38
-
39
- it "can open a dwg file" do
40
- app.can_open?('test.dwg').should be_true
41
- end
42
-
43
- it "can open a dgn file" do
44
- app.can_open?('test.dgn').should be_true
45
- end
46
-
47
- it "can't open any other type of files" do
48
- %w(xls doc txt png tiff odf).each do |format|
49
- app.can_open?("test.#{format}").should be_false
50
- end
51
- end
52
- end
53
-
54
- describe "#open_drawing" do
55
-
56
- after(:each) do
57
- app.close_active_drawing
58
- end
59
-
60
-
61
- let (:valid_file){ @existing_drawing_path }
62
- let (:invalid_file) {"bogus file"}
63
-
64
- it "returns a drawing if drawing exists" do
65
- drawing = app.open_drawing(valid_file)
66
- drawing.class.should == Microstation::Drawing
67
- app.active_design_file.should.eql? drawing.ole_obj
68
- end
69
-
70
- it "raises error if drawing does not exist" do
71
- expect {
72
- app.open_drawing(invalid_file)
73
- }.to raise_error
74
- end
75
-
76
- describe "when given a block" do
77
-
78
- it "yields the drawing to a block if a block is given" do
79
- app.open_drawing(valid_file) do |drawing|
80
- drawing.class.should == Microstation::Drawing
81
- app.active_design_file.should.eql? drawing.ole_obj
82
- end
83
- end
84
-
85
-
86
- it "closes drawing after block returns" do
87
- app.active_design_file.should == nil
88
- app.open_drawing(valid_file) do |drawing|
89
- app.active_design_file.should.eql? drawing.ole_obj
90
- end
91
- app.active_design_file.should == nil
92
- end
93
-
94
- end
95
-
96
- end
97
-
98
- it "has an ole_object" do
99
- app.ole_obj.class.should == ::WIN32OLE
100
- end
101
-
102
- describe "load constants" do
103
- it "should load the constants" do
104
- app.load_constants
105
- Microstation::MSD::MsdElementTypeTag.should == 37
106
- end
107
- end
108
-
109
- describe "create_scanner" do
110
- it "should yield a scanner object" do
111
- app.create_scanner do |scan|
112
- scan.should be_instance_of Microstation::Scan::Criteria
113
- scan.include_tags
114
- scan.include_color(3)
115
- end
116
-
117
- end
118
- end
119
-
120
-
121
-
122
-
123
- describe "#create_ole_scanner" do
124
- it "returns an ole scanner" do
125
- pending
126
- scanner = app.create_ole_scan_criteria
127
- scanner.ole_type.to_s.should =~ /_ElementScanCriteria/
128
- end
129
- end
130
-
131
- describe "#normalize_name(name)" do
132
-
133
- it "returns the name if the name is absolute" do
134
- app.normalize_name("c:/my_drawings/cool.dng").to_s.should == "c:/my_drawings/cool.dgn"
135
- end
136
-
137
- context "when given a relative path and project dir is set" do
138
- it "returns the name joined with the project_dir" do
139
- app.project_dir = "c:/projects/new"
140
- app.normalize_name('cool_beans.dng').to_s.should == "c:/projects/new/cool_beans.dgn"
141
- end
142
-
143
- end
144
-
145
- context "when project_dir is nil" do
146
- it "returns name relative to the calling process" do
147
- app.project_dir = nil
148
- app.normalize_name('cool_beans.dng').to_s.should == (Pathname.getwd + 'cool_beans.dgn').to_s
149
- end
150
- end
151
- end
152
-
153
- it "#windows path method" do
154
- pending
155
- app.windows_path( drawing_path("")).should == "c:\\test"
156
- end
157
-
158
-
159
- it "should have a #username" do
160
- app.username.should == ENV["USERNAME"]
161
- end
162
-
163
- describe "#new_drawing" do
164
- # before(:each) do
165
- # @new_name = "my_new_drawing.dgn"
166
- # @new_drawing_path = drawing_path(@new_name)
167
- # @existing_drawing_path = drawing_path('test.dgn')
168
- # end
169
-
170
- after(:each) do
171
- app.close_active_drawing
172
- # File.delete(@new_drawing_path) if File.exist?(@new_drawing_path)
173
- end
174
-
175
- let(:existing_drawing){ @existing_drawing_path }
176
- let(:new_drawing) { @new_drawing_path }
177
-
178
-
179
- it "needs a filename" do
180
- expect{ app.new_drawing()}.to raise_error
181
- end
182
-
183
- it "raises an error if drawing exists" do
184
- expect {
185
- app.new_drawing(existing_drawing).to raise_error
186
- }
187
- end
188
-
189
- it "creates a drawing if it's a new drawing_name" do
190
- drawing = app.new_drawing(new_drawing)
191
- drawing.should be_an_instance_of Microstation::Drawing
192
- end
193
-
194
- describe "when given a block" do
195
-
196
- it "yields the drawing to a block if a block is given" do
197
- app.new_drawing(new_drawing) do |drawing|
198
- drawing.class.should == Microstation::Drawing
199
- app.active_design_file.should.eql? drawing.ole_obj
200
- end
201
- end
202
-
203
-
204
- it "closes drawing after block returns" do
205
- app.active_design_file.should == nil
206
- app.new_drawing(new_drawing) do |drawing|
207
- app.active_design_file.should.eql? drawing.ole_obj
208
- end
209
- app.active_design_file.should == nil
210
- end
211
-
212
- end
213
-
214
- end
215
-
216
- describe "an app with an open drawing" do
217
- before(:each) do
218
- @drawing = app.new_drawing(@new_drawing_path)
219
- end
220
-
221
- after(:each) do
222
- app.close_active_drawing
223
- # File.delete(@new_drawing_path) if File.exist? (@new_drawing_path)
224
- end
225
-
226
- describe "#scan" do
227
- it "defaults to all objects without a scan criteria" do
228
- pending
229
- expect{app.scan}.to_not raise_error
230
- end
231
-
232
- it "resolves the scan criteria" do
233
- scanner = app.create_scanner do |scan|
234
- scan.include_textual
235
- end
236
- scanner.should_receive("resolve")
237
- app.scan(scanner)
238
- end
239
-
240
-
241
-
242
- end
243
-
244
- # describe "#current_drawing" do
245
- # it "returns the current drawing" do
246
- # binding.pry
247
- # app.current_drawing.should == @drawing
248
- # end
249
-
250
- # end
251
-
252
-
253
-
254
-
255
- end
256
-
257
- # it "forwards method missing" do
258
-
259
- # @app.ole_obj.should_receive("Open")
260
- # @app.Open("this is a drawing")
261
-
262
-
263
- # end
264
-
265
-
266
- end
267
-
@@ -1,122 +0,0 @@
1
- require File.join(File.dirname(__FILE__) , 'spec_helper')
2
- require 'pry'
3
-
4
- describe Microstation::Configuration do
5
-
6
- before(:all) do
7
- @app = Microstation::App.new
8
- @configuration = Microstation::Configuration.new(@app)
9
- @defined_variable = "new_variable"
10
- @defined_variable_value = "variable_value"
11
- @configuration[@defined_variable] = @defined_variable_value
12
- @undefined_variable = 'undefined'
13
- @configuration.remove_variable('undefined')
14
- end
15
-
16
- after(:all) do
17
- @configuration.remove_variable(@defined_variable)
18
- @app.quit
19
- end
20
-
21
-
22
- describe "#exists" do
23
- let(:variable){ @defined_variable}
24
- let(:undefined){ @undefined_variable}
25
- subject { @configuration}
26
-
27
- it "should return true if config variable is exists" do
28
- subject.exists?(variable).should be_true
29
- end
30
-
31
- it "should return false if config variable doesn't exist" do
32
- subject.exists?(undefined).should be_false
33
- end
34
-
35
- end
36
-
37
- describe "#[]" do
38
- let(:undefined){ @undefined_variable}
39
- let(:variable){ @defined_variable}
40
- subject{@configuration}
41
-
42
- it "should check if value exists" do
43
- subject.should_receive(:exists?).with('undefined')
44
- expect(subject[undefined]).to be_nil
45
- end
46
-
47
- it "should return the configuration variable if exists" do
48
- expect(subject[variable]).to eq 'variable_value'
49
- end
50
-
51
- it "should return nil if not exists" do
52
- expect(@configuration[undefined]).to equal nil
53
- end
54
-
55
-
56
- end
57
-
58
- describe "#should update" do
59
-
60
- let(:undefined){@undefined}
61
- let(:variable){@defined_variable}
62
-
63
- it "should return true if key doesn't exist" do
64
- @configuration.should_update?(undefined).should be_true
65
- end
66
-
67
- it "should return false if key exists? and options[:force] is false or nil" do
68
- @configuration.should_update?(variable).should be_false
69
- end
70
-
71
- it "should return true if key exists? and options[:force] is true" do
72
- @configuration.should_update?(variable, {:force => true}).should be_true
73
- end
74
-
75
- end
76
-
77
- describe "setting variables" do
78
-
79
- before(:each) do
80
- @variable = "TEST_VARIABLE"
81
- @configuration.remove_variable(@variable)
82
- end
83
-
84
- context "value not existing yet" do
85
-
86
- it "should set the variable" do
87
- @configuration[@variable].should == nil
88
- @configuration[@variable] = "a new variable"
89
- @configuration[@variable].should == "a new variable"
90
- end
91
-
92
- end
93
-
94
- context "value existing" do
95
-
96
- let(:variable){@defined_variable}
97
- subject{ @configuration}
98
-
99
- it "should raise variable defined if force option is false" do
100
- @configuration[variable].should == 'variable_value'
101
- expect{ @configuration[variable]= "my new value"}.to raise_error Microstation::VariableDefined
102
- @configuration[variable].should == "variable_value"
103
- end
104
-
105
- it "should change the variable if force is true" do
106
- @configuration[variable].should == "variable_value"
107
- @configuration.set(variable, "my new value", :force => true)
108
- @configuration[variable].should == "my new value"
109
- end
110
-
111
- end
112
-
113
- describe "#expand" do
114
- it "should be able to expand string" do
115
- @configuration.expand( "$(_USTN_USER)$(_USTN_USERNAME).txt").should_not be_nil
116
-
117
- end
118
-
119
- end
120
-
121
- end
122
- end
data/spec/drawing_spec.rb DELETED
@@ -1,247 +0,0 @@
1
- require File.join(File.dirname(__FILE__) , 'spec_helper')
2
-
3
- module DrawingHelpers
4
-
5
- def create_new_drawing_path(name)
6
- path = drawing_path(name)
7
- File.delete(path) if File.exist? path
8
- return path
9
- end
10
-
11
- end
12
-
13
- describe Microstation::Drawing do
14
- include DrawingHelpers
15
-
16
- context "a drawing created with app.new_drawing" do
17
-
18
- before(:all) do
19
- @app = Microstation::App.new
20
- # debugger
21
- @drawing_name = 'my_new_drawing.dgn'
22
- @new_drawing_path = create_new_drawing_path('my_new_drawing.dgn')
23
- @new_drawing = @app.new_drawing(@new_drawing_path)
24
- end
25
-
26
- after(:all) do
27
- @app.close_active_drawing if @app
28
- @app.quit if @app
29
- File.delete(@new_drawing_path) if File.exist?(@new_drawing_path || "")
30
- end
31
-
32
- let(:new_drawing) { @new_drawing}
33
- let(:new_drawing_path) { @new_drawing_path }
34
- let(:new_drawing_name) {@drawing_name}
35
-
36
- # describe "#name and path" do
37
-
38
-
39
-
40
-
41
- # context "when given a relative name and no project_dir" do
42
- # before(:each) do
43
- # @app.project_dir = nil
44
- # @drawing_name = "my drawing.dgn"
45
- # @path = @app.normalize_name(@drawing_name)
46
-
47
- # end
48
-
49
- # after(:each) do
50
- # @path.unlink
51
- # end
52
-
53
- # subject{@app.new_drawing(@drawing_name) }
54
-
55
-
56
- # it "#name should be set to the name of the drawing with .dgn extension" do
57
- # subject.name.should =~ "my drawing.dgn"
58
- # end
59
-
60
- # it "#path should be the working path" do
61
- # subject.path.should == Pathname.getwd
62
- # end
63
-
64
- # end
65
-
66
- # context "when given a relative name and a project_dir" do
67
-
68
- # before(:each) do
69
- # @app.project_dir = "c:/my_projects/"
70
- # @new_drawing = @app.new_drawing('my drawing')
71
- # end
72
-
73
- # after(:each) do
74
- # File.delete(@new_drawing.full_path)
75
- # end
76
-
77
-
78
- # it "name should be the name of the drawing" do
79
- # @new_drawing.name.should == 'my drawing.dng'
80
- # end
81
-
82
- # it "path should == the project_dir" do
83
- # drawing.path.should == "c:\\my_projects"
84
- # end
85
-
86
- # end
87
- # end
88
-
89
- it "should be the active drawing" do
90
- new_drawing.should be_active
91
- end
92
-
93
- describe "#author" do
94
-
95
- it "should be '' to start" do
96
- pending
97
- new_drawing.author.should == ""
98
- end
99
-
100
- it "should set author if given a new author" do
101
- new_drawing.author = "A newer author"
102
- new_drawing.author.should == "A newer author"
103
- end
104
-
105
- end
106
-
107
- describe "#title" do
108
- it "should be '' to start" do
109
- new_drawing.title.should == ""
110
- end
111
-
112
- it "should set title if given a new title" do
113
- new_drawing.title = "a new title"
114
- new_drawing.title.should == "a new title"
115
- end
116
-
117
- end
118
-
119
- describe "#keywords" do
120
- it "should be empty to start" do
121
- new_drawing.keywords.should == ""
122
- end
123
-
124
- it "should set keywords if given a string of words" do
125
- new_drawing.keywords = "project, rcl, new"
126
- new_drawing.keywords.should == "project, rcl, new"
127
- end
128
- end
129
-
130
-
131
- it "should have a #comments method" do
132
- new_drawing.comments.should == ""
133
- new_drawing.comments = "these are the comments"
134
- new_drawing.comments.should == "these are the comments"
135
- end
136
-
137
-
138
-
139
-
140
- it "should have a two_d? method" do
141
- new_drawing.should be_two_d
142
- end
143
-
144
- it "should be able to save as pdf" do
145
- new_drawing.save_as_pdf
146
- end
147
-
148
- describe "revision count" do
149
- it "should have a revision_count" do
150
- new_drawing.should respond_to "revision_count"
151
- end
152
-
153
- it "should forward method" do
154
- new_drawing.ole_obj.should_receive("DesignRevisionCount").and_return(0)
155
- new_drawing.revision_count
156
- end
157
- end
158
-
159
- describe "pdf_name" do
160
- it "should be the passed in dirname + name with pdf changed for ext" do
161
- new_drawing.pdf_name("my_name","output").to_s.should == File.expand_path(File.join('output', "my_name.pdf"))
162
- end
163
-
164
- it "should == the name of the drawing file #basename with pdf ext with no args" do
165
- new_drawing.stub(:basename).and_return "Drawing Name"
166
- File.extname(new_drawing.pdf_name).should == '.pdf'
167
- File.basename(new_drawing.pdf_name, '.pdf').should == "Drawing Name"
168
- end
169
-
170
- end
171
-
172
-
173
- context "save_as_pdf" do
174
- it "should use the filename if given in args" do
175
- new_drawing.save_as_pdf("testfile")
176
- end
177
- end
178
-
179
- describe "scanning" do
180
-
181
- it "should have a #create_scanner" do
182
- scanner = new_drawing.create_scanner
183
- scanner.include_textual
184
- end
185
-
186
- it "should scan the drawing" do
187
- scanner = new_drawing.create_scanner do |scan|
188
- scan.include_textual
189
- end
190
- new_drawing.scan(scanner)
191
- end
192
- end
193
-
194
-
195
- describe "#scan_text" do
196
-
197
- it "only yields textual items" do
198
-
199
- new_drawing.scan_text do |item|
200
- item.class.should == (Microstation::Text || Microstation::TextNode)
201
- end
202
- end
203
- end
204
-
205
-
206
-
207
- end
208
- end
209
-
210
-
211
-
212
-
213
-
214
-
215
- # describe "#new_drawing" do
216
- # before(:each) do
217
- # ENV["USERNAME"] = "test person"
218
- # end
219
-
220
- # after(:each) do
221
- # @drawing.close
222
- # @drawing = nil
223
- # end
224
-
225
- # it "should set author" do
226
- # @app.should_receive(:username).and_return("test person")
227
- # @drawing = @app.new_drawing(new_drawing_path)
228
- # @drawing.author.should == "test person"
229
- # end
230
-
231
- # end
232
-
233
- # describe "creating a new drawing" do
234
- # before(:each) do
235
- # @drawing = @app.new_drawing(new_drawing_path)
236
- # end
237
-
238
- # after(:each) do
239
- # @drawing.close
240
- # @drawing = nil
241
- # end
242
-
243
-
244
-
245
-
246
-
247
-
Binary file
Binary file
Binary file
Binary file
@@ -1,60 +0,0 @@
1
- require File.join(File.dirname(__FILE__) , 'spec_helper')
2
-
3
- describe "Microstation::Enumerator" do
4
-
5
- context "given a drawing scanned with a textual criteria" do
6
-
7
- before(:all) do
8
- @app = Microstation::App.new
9
- @drawing = open_existing_drawing(@app)
10
- @criteria = @app.create_scanner do |scan|
11
- scan.include_textual
12
- end
13
-
14
- end
15
-
16
- after(:all) do
17
- @app.close_active_drawing
18
- @app.quit
19
- # path = @drawing.full_path
20
- #path.delete
21
- end
22
-
23
- let(:app) { @app}
24
- let(:drawing){@drawing}
25
-
26
- describe "app.scan" do
27
- it "returns an Enumerator" do
28
- pending
29
- enum = app.scan(@criteria)
30
- enum.should be_an_instance_of Microstation::Enumerator
31
- end
32
-
33
- it "should be a text node" do
34
- enum = app.scan(@criteria).to_enum
35
- first = enum.next
36
- first.should be_an_instance_of Microstation::Text
37
- end
38
-
39
- it "should all be textual" do
40
- pending
41
- enum = app.scan(@criteria)
42
- values = enum.map{|i| i}
43
- end
44
-
45
-
46
- end
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
- end
55
-
56
- end
57
-
58
-
59
-
60
-