Sha256: 4e0bfa71e1b3958baa9f72dc1f805ab894029f9590755f6dba5fe45b06185392

Contents?: true

Size: 1.38 KB

Versions: 69

Compression:

Stored size: 1.38 KB

Contents

# -*- coding: utf-8 -*-
require 'spec_helper'
require_relative 'shared/block_examples'

# rubocop:disable EmptyLines, LineLength

describe RubyToBlock::Block::MotionMove, to_blocks: true do
  parts = <<-EOS
move(6)
  EOS
  describe compact_source_code(parts), on_start_data: true do
    _parts = parts
    let(:parts) { _parts }

    it '結果が正しいこと' do
      should eq_block_xml(<<-XML)
          <block type="motion_move" inline="true">
            <value name="STEP">
              <block type="math_number">
                <field name="NUM">6</field>
              </block>
            </value>
          </block>
      XML
    end
  end

  parts = <<-EOS
car1.move(6)
  EOS
  describe compact_source_code(parts), character_new_data: true do
    _parts = parts
    let(:parts) { _parts }

    it '結果が正しいこと' do
      should eq_block_xml(<<-XML)
      <block type="motion_move" inline="true">
        <value name="STEP">
          <block type="math_number">
            <field name="NUM">6</field>
          </block>
        </value>
      </block>
      XML
    end
  end

  parts = <<-EOS
move(6)
  EOS
  describe compact_source_code(parts) do
    _parts = parts
    let(:data) { _parts }

    it '結果が正しいこと' do
      should eq_block_xml(<<-XML)
  <block type="ruby_statement">
    <field name="STATEMENT">move(6)</field>
  </block>
      XML
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
smalruby-editor-0.1.21-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.21 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.20-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.20 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.19-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.19 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.18-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.18 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.17-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.17 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.16-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.16 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.15-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.15 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.14-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.14 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.13-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.13 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.12-x86-mingw32 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb
smalruby-editor-0.1.12 spec/models/concerns/ruby_to_block/block/motion_move_spec.rb