smalruby-editor 0.1.20-x86-mingw32 → 0.1.21-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smalruby-editor might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/app/assets/javascripts/blocks/character.js.coffee.erb +3 -10
- data/app/assets/javascripts/blocks/control.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/data.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/etc.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/events.js.coffee.erb +5 -4
- data/app/assets/javascripts/blocks/field_character.js.coffee.erb +9 -0
- data/app/assets/javascripts/blocks/hardware.js.coffee.erb +171 -54
- data/app/assets/javascripts/blocks/looks.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/motion.js.coffee.erb +4 -16
- data/app/assets/javascripts/blocks/operators.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/pen.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/ruby.js.coffee.erb +2 -1
- data/app/assets/javascripts/blocks/sensing.js.coffee.erb +25 -3
- data/app/assets/javascripts/blocks/sound.js.coffee.erb +2 -1
- data/app/assets/javascripts/generators/ruby.js.coffee.erb +27 -5
- data/app/assets/javascripts/models/source_code.js.coffee +20 -7
- data/app/assets/javascripts/views/main_menu_view.js.coffee +5 -7
- data/app/assets/stylesheets/editor.css.scss +5 -1
- data/app/assets/stylesheets/toolbox.css.scss.erb +29 -24
- data/app/controllers/source_codes_controller.rb +7 -36
- data/app/helpers/editor_helper.rb +9 -0
- data/app/models/concerns/ruby_to_block/block/hardware_button_down_or_up.rb +25 -0
- data/app/models/concerns/ruby_to_block/block/hardware_button_not_use_pullup.rb +18 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver.rb +22 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_set_speed.rb +20 -0
- data/app/models/concerns/ruby_to_block/block/hardware_motor_driver_speed.rb +24 -0
- data/app/models/concerns/ruby_to_block/block/hardware_on_button_down_or_up.rb +19 -0
- data/app/models/concerns/ruby_to_block/block/hardware_operation.rb +15 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_set_speed.rb +22 -0
- data/app/models/concerns/ruby_to_block/block/hardware_two_wheel_drive_car_speed.rb +26 -0
- data/app/models/concerns/ruby_to_block/block/ruby_p.rb +19 -0
- data/app/models/concerns/ruby_to_block/block/{motion_reach_wall.rb → sensing_reach_wall.rb} +1 -1
- data/app/models/concerns/ruby_to_block/block/text.rb +3 -2
- data/app/models/source_code.rb +20 -0
- data/app/views/editor/_toolbox.html.haml +84 -63
- data/app/views/editor/index.html.haml +1 -1
- data/demos/adjust_2wd_car.rb.xml +179 -0
- data/demos/car_chase.rb.xml +129 -126
- data/demos/hardware_led.rb.xml +7 -4
- data/demos/pong.rb.xml +17 -14
- data/demos/star.rb.xml +115 -112
- data/lib/smalruby_editor/version.rb +3 -3
- data/lib/smalruby_editor.rb +16 -0
- data/public/assets/{application-c8991557a0789ac1bc9220f409e7f1c1.js → application-734570836cdba680c1568220a51af40f.js} +216 -86
- data/public/assets/{application-c8991557a0789ac1bc9220f409e7f1c1.js.gz → application-734570836cdba680c1568220a51af40f.js.gz} +0 -0
- data/public/assets/{application-d4fe6c0f970efe8eab9267fd08718d96.css → application-898cb749439fba4ce44cffeac1216201.css} +37 -9
- data/public/assets/{application-d4fe6c0f970efe8eab9267fd08718d96.css.gz → application-898cb749439fba4ce44cffeac1216201.css.gz} +0 -0
- data/public/assets/manifest-332a5a1668194028b55103e0ea45c054.json +1 -1
- data/smalruby-editor.gemspec +2 -1
- data/spec/acceptance/block_mode/blocks/events/on_hit.feature +2 -0
- data/spec/acceptance/block_mode/blocks/hardware/button_down_or_up.feature +79 -0
- data/spec/acceptance/block_mode/blocks/hardware/button_not_use_pullup.feature +61 -0
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver.feature +73 -0
- data/spec/acceptance/block_mode/blocks/hardware/motor_driver_speed.feature +93 -0
- data/spec/acceptance/block_mode/blocks/hardware/on_button_down_or_up.feature +87 -0
- data/spec/acceptance/block_mode/blocks/hardware/two_wheel_drive_car_speed.feature +111 -0
- data/spec/acceptance/block_mode/blocks/motion/reach_wall.feature +1 -1
- data/spec/acceptance/block_mode/blocks/operators/text.feature +38 -0
- data/spec/acceptance/block_mode/blocks/sensing/hit.feature +98 -52
- data/spec/acceptance/block_mode/blocks/sensing/reach_wall.feature +98 -0
- data/spec/acceptance/block_mode/demo.feature +3 -1
- data/spec/acceptance/standalone/save.feature +51 -0
- data/spec/helpers/editor_helper_spec.rb +20 -0
- data/spec/javascripts/models/source_code_spec.coffee +40 -0
- data/spec/models/concerns/ruby_to_block/block/hardware_spec.rb +269 -0
- data/spec/models/concerns/ruby_to_block/block/motion_spec.rb +1 -1
- data/spec/models/concerns/ruby_to_block/block/{motion_reach_wall_spec.rb → sensing_reach_wall_spec.rb} +2 -2
- data/spec/models/concerns/ruby_to_block/block/text_spec.rb +39 -0
- data/spec/models/concerns/ruby_to_block_spec.rb +2 -2
- data/spec/models/source_code_spec.rb +53 -0
- data/spec/steps/base_steps.rb +5 -0
- metadata +56 -12
- data/demos/rgb_led_anode.rb.xml +0 -83
@@ -197,4 +197,273 @@ end
|
|
197
197
|
XML
|
198
198
|
end
|
199
199
|
end
|
200
|
+
|
201
|
+
parts = <<-EOS
|
202
|
+
require "smalruby"
|
203
|
+
|
204
|
+
init_hardware
|
205
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
206
|
+
|
207
|
+
car1.on(:start) do
|
208
|
+
motor_driver("D3").speed = 50
|
209
|
+
p(motor_driver("D3").speed)
|
210
|
+
motor_driver("D3").forward
|
211
|
+
motor_driver("D3").backward
|
212
|
+
end
|
213
|
+
car1.motor_driver("D3").speed = 50
|
214
|
+
p(car1.motor_driver("D3").speed)
|
215
|
+
car1.motor_driver("D3").stop
|
216
|
+
EOS
|
217
|
+
describe compact_source_code(parts) do
|
218
|
+
_parts = parts
|
219
|
+
let(:data) { _parts }
|
220
|
+
|
221
|
+
it '結果が正しいこと' do
|
222
|
+
should eq_block_xml(<<-XML)
|
223
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
224
|
+
<block type="hardware_init_hardware" />
|
225
|
+
<block type="character_new">
|
226
|
+
<field name="NAME">car1</field>
|
227
|
+
<statement name="DO">
|
228
|
+
<block type="events_on_start">
|
229
|
+
<statement name="DO">
|
230
|
+
<block type="hardware_motor_driver_set_speed" inline="true">
|
231
|
+
<field name="PIN">D3</field>
|
232
|
+
<value name="SPEED">
|
233
|
+
<block type="math_number">
|
234
|
+
<field name="NUM">50</field>
|
235
|
+
</block>
|
236
|
+
</value>
|
237
|
+
<next>
|
238
|
+
<block type="ruby_p" inline="true">
|
239
|
+
<value name="ARG">
|
240
|
+
<block type="hardware_motor_driver_speed">
|
241
|
+
<field name="PIN">D3</field>
|
242
|
+
</block>
|
243
|
+
</value>
|
244
|
+
<next>
|
245
|
+
<block type="hardware_motor_driver">
|
246
|
+
<field name="PIN">D3</field>
|
247
|
+
<field name="METHOD">forward</field>
|
248
|
+
<next>
|
249
|
+
<block type="hardware_motor_driver">
|
250
|
+
<field name="PIN">D3</field>
|
251
|
+
<field name="METHOD">backward</field>
|
252
|
+
</block>
|
253
|
+
</next>
|
254
|
+
</block>
|
255
|
+
</next>
|
256
|
+
</block>
|
257
|
+
</next>
|
258
|
+
</block>
|
259
|
+
</statement>
|
260
|
+
<next>
|
261
|
+
<block type="hardware_motor_driver_set_speed" inline="true">
|
262
|
+
<field name="PIN">D3</field>
|
263
|
+
<value name="SPEED">
|
264
|
+
<block type="math_number">
|
265
|
+
<field name="NUM">50</field>
|
266
|
+
</block>
|
267
|
+
</value>
|
268
|
+
<next>
|
269
|
+
<block type="ruby_p" inline="true">
|
270
|
+
<value name="ARG">
|
271
|
+
<block type="hardware_motor_driver_speed">
|
272
|
+
<field name="PIN">D3</field>
|
273
|
+
</block>
|
274
|
+
</value>
|
275
|
+
<next>
|
276
|
+
<block type="hardware_motor_driver">
|
277
|
+
<field name="PIN">D3</field>
|
278
|
+
<field name="METHOD">stop</field>
|
279
|
+
</block>
|
280
|
+
</next>
|
281
|
+
</block>
|
282
|
+
</next>
|
283
|
+
</block>
|
284
|
+
</next>
|
285
|
+
</block>
|
286
|
+
</statement>
|
287
|
+
</block>
|
288
|
+
XML
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
parts = <<-EOS
|
293
|
+
require "smalruby"
|
294
|
+
|
295
|
+
init_hardware
|
296
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
297
|
+
|
298
|
+
car1.on(:start) do
|
299
|
+
two_wheel_drive_car("D5").left_speed = 50
|
300
|
+
p(two_wheel_drive_car("D5").left_speed)
|
301
|
+
two_wheel_drive_car("D5").forward
|
302
|
+
two_wheel_drive_car("D5").backward
|
303
|
+
end
|
304
|
+
car1.two_wheel_drive_car("D5").right_speed = 50
|
305
|
+
p(car1.two_wheel_drive_car("D5").right_speed)
|
306
|
+
car1.two_wheel_drive_car("D5").stop
|
307
|
+
EOS
|
308
|
+
describe compact_source_code(parts) do
|
309
|
+
_parts = parts
|
310
|
+
let(:data) { _parts }
|
311
|
+
|
312
|
+
it '結果が正しいこと' do
|
313
|
+
should eq_block_xml(<<-XML)
|
314
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
315
|
+
<block type="hardware_init_hardware" />
|
316
|
+
<block type="character_new">
|
317
|
+
<field name="NAME">car1</field>
|
318
|
+
<statement name="DO">
|
319
|
+
<block type="events_on_start">
|
320
|
+
<statement name="DO">
|
321
|
+
<block type="hardware_two_wheel_drive_car_set_speed" inline="true">
|
322
|
+
<field name="PIN">D5</field>
|
323
|
+
<field name="LOR">left</field>
|
324
|
+
<value name="SPEED">
|
325
|
+
<block type="math_number">
|
326
|
+
<field name="NUM">50</field>
|
327
|
+
</block>
|
328
|
+
</value>
|
329
|
+
<next>
|
330
|
+
<block type="ruby_p" inline="true">
|
331
|
+
<value name="ARG">
|
332
|
+
<block type="hardware_two_wheel_drive_car_speed">
|
333
|
+
<field name="PIN">D5</field>
|
334
|
+
<field name="LOR">left</field>
|
335
|
+
</block>
|
336
|
+
</value>
|
337
|
+
<next>
|
338
|
+
<block type="hardware_two_wheel_drive_car_forward">
|
339
|
+
<field name="PIN">D5</field>
|
340
|
+
<next>
|
341
|
+
<block type="hardware_two_wheel_drive_car_backward">
|
342
|
+
<field name="PIN">D5</field>
|
343
|
+
</block>
|
344
|
+
</next>
|
345
|
+
</block>
|
346
|
+
</next>
|
347
|
+
</block>
|
348
|
+
</next>
|
349
|
+
</block>
|
350
|
+
</statement>
|
351
|
+
<next>
|
352
|
+
<block type="hardware_two_wheel_drive_car_set_speed" inline="true">
|
353
|
+
<field name="PIN">D5</field>
|
354
|
+
<field name="LOR">right</field>
|
355
|
+
<value name="SPEED">
|
356
|
+
<block type="math_number">
|
357
|
+
<field name="NUM">50</field>
|
358
|
+
</block>
|
359
|
+
</value>
|
360
|
+
<next>
|
361
|
+
<block type="ruby_p" inline="true">
|
362
|
+
<value name="ARG">
|
363
|
+
<block type="hardware_two_wheel_drive_car_speed">
|
364
|
+
<field name="PIN">D5</field>
|
365
|
+
<field name="LOR">right</field>
|
366
|
+
</block>
|
367
|
+
</value>
|
368
|
+
<next>
|
369
|
+
<block type="hardware_two_wheel_drive_car_stop">
|
370
|
+
<field name="PIN">D5</field>
|
371
|
+
</block>
|
372
|
+
</next>
|
373
|
+
</block>
|
374
|
+
</next>
|
375
|
+
</block>
|
376
|
+
</next>
|
377
|
+
</block>
|
378
|
+
</statement>
|
379
|
+
</block>
|
380
|
+
XML
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
parts = <<-EOS
|
385
|
+
require "smalruby"
|
386
|
+
|
387
|
+
init_hardware
|
388
|
+
car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0)
|
389
|
+
|
390
|
+
car1.on(:button_down, "D3") do
|
391
|
+
p(button("D3").up?)
|
392
|
+
p(button("D3").down?)
|
393
|
+
button("D3").not_use_pullup
|
394
|
+
end
|
395
|
+
p(car1.button("D3").up?)
|
396
|
+
p(car1.button("D3").down?)
|
397
|
+
car1.button("D3").not_use_pullup
|
398
|
+
EOS
|
399
|
+
describe compact_source_code(parts) do
|
400
|
+
_parts = parts
|
401
|
+
let(:data) { _parts }
|
402
|
+
|
403
|
+
it '結果が正しいこと' do
|
404
|
+
should eq_block_xml(<<-XML)
|
405
|
+
<character name="car1" x="0" y="0" angle="0" costumes="car1.png" />
|
406
|
+
<block type="hardware_init_hardware" />
|
407
|
+
<block type="character_new">
|
408
|
+
<field name="NAME">car1</field>
|
409
|
+
<statement name="DO">
|
410
|
+
<block type="hardware_on_button_down_or_up">
|
411
|
+
<field name="PIN">D3</field>
|
412
|
+
<field name="DOU">down</field>
|
413
|
+
<statement name="DO">
|
414
|
+
<block type="ruby_p" inline="true">
|
415
|
+
<value name="ARG">
|
416
|
+
<block type="hardware_button_down_or_up">
|
417
|
+
<field name="PIN">D3</field>
|
418
|
+
<field name="DOU">up</field>
|
419
|
+
</block>
|
420
|
+
</value>
|
421
|
+
<next>
|
422
|
+
<block type="ruby_p" inline="true">
|
423
|
+
<value name="ARG">
|
424
|
+
<block type="hardware_button_down_or_up">
|
425
|
+
<field name="PIN">D3</field>
|
426
|
+
<field name="DOU">down</field>
|
427
|
+
</block>
|
428
|
+
</value>
|
429
|
+
<next>
|
430
|
+
<block type="hardware_button_not_use_pullup">
|
431
|
+
<field name="PIN">D3</field>
|
432
|
+
</block>
|
433
|
+
</next>
|
434
|
+
</block>
|
435
|
+
</next>
|
436
|
+
</block>
|
437
|
+
</statement>
|
438
|
+
<next>
|
439
|
+
<block type="ruby_p" inline="true">
|
440
|
+
<value name="ARG">
|
441
|
+
<block type="hardware_button_down_or_up">
|
442
|
+
<field name="PIN">D3</field>
|
443
|
+
<field name="DOU">up</field>
|
444
|
+
</block>
|
445
|
+
</value>
|
446
|
+
<next>
|
447
|
+
<block type="ruby_p" inline="true">
|
448
|
+
<value name="ARG">
|
449
|
+
<block type="hardware_button_down_or_up">
|
450
|
+
<field name="PIN">D3</field>
|
451
|
+
<field name="DOU">down</field>
|
452
|
+
</block>
|
453
|
+
</value>
|
454
|
+
<next>
|
455
|
+
<block type="hardware_button_not_use_pullup">
|
456
|
+
<field name="PIN">D3</field>
|
457
|
+
</block>
|
458
|
+
</next>
|
459
|
+
</block>
|
460
|
+
</next>
|
461
|
+
</block>
|
462
|
+
</next>
|
463
|
+
</block>
|
464
|
+
</statement>
|
465
|
+
</block>
|
466
|
+
XML
|
467
|
+
end
|
468
|
+
end
|
200
469
|
end
|
@@ -276,7 +276,7 @@ car1.point_towards(car1)
|
|
276
276
|
<next>
|
277
277
|
<block type="control_if" inline="true">
|
278
278
|
<value name="COND">
|
279
|
-
<block type="
|
279
|
+
<block type="sensing_reach_wall" />
|
280
280
|
</value>
|
281
281
|
<statement name="THEN">
|
282
282
|
<block type="motion_turn" />
|
@@ -4,7 +4,7 @@ require_relative 'shared/block_examples'
|
|
4
4
|
|
5
5
|
# rubocop:disable EmptyLines, LineLength
|
6
6
|
|
7
|
-
describe RubyToBlock::Block::
|
7
|
+
describe RubyToBlock::Block::SensingReachWall, to_blocks: true do
|
8
8
|
parts = <<-EOS
|
9
9
|
if reach_wall?
|
10
10
|
|
@@ -18,7 +18,7 @@ end
|
|
18
18
|
should eq_block_xml(<<-XML)
|
19
19
|
<block type="control_if" inline="true">
|
20
20
|
<value name="COND">
|
21
|
-
<block type="
|
21
|
+
<block type="sensing_reach_wall" />
|
22
22
|
</value>
|
23
23
|
</block>
|
24
24
|
XML
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
require_relative 'shared/block_examples'
|
4
|
+
|
5
|
+
# rubocop:disable EmptyLines, LineLength
|
6
|
+
|
7
|
+
describe RubyToBlock::Block::Text, to_blocks: true do
|
8
|
+
parts = <<-EOS
|
9
|
+
require "smalruby"
|
10
|
+
|
11
|
+
p("こんにちは")
|
12
|
+
p("\\"\\"")
|
13
|
+
EOS
|
14
|
+
describe compact_source_code(parts) do
|
15
|
+
_parts = parts
|
16
|
+
let(:data) { _parts }
|
17
|
+
|
18
|
+
it '結果が正しいこと' do
|
19
|
+
should eq_block_xml(<<-XML)
|
20
|
+
<block type="ruby_p" inline="true">
|
21
|
+
<value name="ARG">
|
22
|
+
<block type="text">
|
23
|
+
<field name="TEXT">こんにちは</field>
|
24
|
+
</block>
|
25
|
+
</value>
|
26
|
+
<next>
|
27
|
+
<block type="ruby_p" inline="true">
|
28
|
+
<value name="ARG">
|
29
|
+
<block type="text">
|
30
|
+
<field name="TEXT">""</field>
|
31
|
+
</block>
|
32
|
+
</value>
|
33
|
+
</block>
|
34
|
+
</next>
|
35
|
+
</block>
|
36
|
+
XML
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -102,7 +102,7 @@ end
|
|
102
102
|
<next>
|
103
103
|
<block type="control_if" inline="true">
|
104
104
|
<value name="COND">
|
105
|
-
<block type="
|
105
|
+
<block type="sensing_reach_wall" />
|
106
106
|
</value>
|
107
107
|
<statement name="THEN">
|
108
108
|
<block type="motion_turn" />
|
@@ -305,7 +305,7 @@ end
|
|
305
305
|
<next>
|
306
306
|
<block type="control_if" inline="true">
|
307
307
|
<value name="COND">
|
308
|
-
<block type="
|
308
|
+
<block type="sensing_reach_wall" />
|
309
309
|
</value>
|
310
310
|
<statement name="THEN">
|
311
311
|
<block type="motion_turn" />
|
@@ -75,4 +75,57 @@ describe SourceCode, 'Rubyのソースコードを表現するモデル' do
|
|
75
75
|
|
76
76
|
it { should eq(Digest::SHA256.hexdigest(data)) }
|
77
77
|
end
|
78
|
+
|
79
|
+
describe '#summary', 'プログラムの概要を取得する' do
|
80
|
+
describe 'XML形式'do
|
81
|
+
let(:xml_path) { rb_path + '.xml' }
|
82
|
+
let(:data) { Rails.root.join(xml_path).read }
|
83
|
+
let(:source_code) {
|
84
|
+
SourceCode.new(filename: File.basename(xml_path), data: data)
|
85
|
+
}
|
86
|
+
|
87
|
+
subject { source_code.summary }
|
88
|
+
|
89
|
+
{
|
90
|
+
car_chase: {
|
91
|
+
title: '車のおいかけっこ',
|
92
|
+
filename: 'car_chase.rb',
|
93
|
+
imageUrl: '/smalruby/assets/car2.png',
|
94
|
+
},
|
95
|
+
star: {
|
96
|
+
title: 'クリックスターだにゃ~',
|
97
|
+
filename: 'star.rb',
|
98
|
+
imageUrl: '/smalruby/assets/cat1.png',
|
99
|
+
},
|
100
|
+
pong: {
|
101
|
+
title: 'ピンポンゲーム',
|
102
|
+
filename: 'pong.rb',
|
103
|
+
imageUrl: '/smalruby/assets/cat2.png',
|
104
|
+
},
|
105
|
+
hardware_led: {
|
106
|
+
title: 'ライトをぴかっとさせるでよ',
|
107
|
+
filename: 'hardware_led.rb',
|
108
|
+
imageUrl: '/smalruby/assets/frog1.png',
|
109
|
+
},
|
110
|
+
adjust_2wd_car: {
|
111
|
+
title: '2WD車の左右のモーターを調整する',
|
112
|
+
filename: 'adjust_2wd_car.rb',
|
113
|
+
imageUrl: '/smalruby/assets/car2.png',
|
114
|
+
},
|
115
|
+
}.each do |name, summary|
|
116
|
+
_rb_path = "demos/#{name}.rb"
|
117
|
+
context "'#{_rb_path + '.xml'}'" do
|
118
|
+
let(:rb_path) { _rb_path }
|
119
|
+
|
120
|
+
summary.each do |key, value|
|
121
|
+
describe key do
|
122
|
+
subject { super()[key] }
|
123
|
+
|
124
|
+
it { should eq(value) }
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
78
131
|
end
|
data/spec/steps/base_steps.rb
CHANGED
@@ -254,6 +254,11 @@ step 'ホームディレクトリの :filename の内容が :program である
|
|
254
254
|
expect(path.read).to eq(program)
|
255
255
|
end
|
256
256
|
|
257
|
+
step 'ホームディレクトリの :filename が次の内容であること:' do |filename, program|
|
258
|
+
path = Pathname("~/#{filename}").expand_path
|
259
|
+
expect(path.read).to eq(program)
|
260
|
+
end
|
261
|
+
|
257
262
|
step ':directory ディレクトリに :program という内容の :filename が存在する' do
|
258
263
|
|directory, program, filename|
|
259
264
|
File.open(Pathname("#{directory}/#{filename}").expand_path, 'w') do |f|
|