Sha256: 877b32adc894a3ea55e5fbfcae9f5933e495d5e39b5fb00822e1999c86f90e32

Contents?: true

Size: 1.39 KB

Versions: 69

Compression:

Stored size: 1.39 KB

Contents

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

# rubocop:disable EmptyLines, LineLength

describe RubyToBlock::Block::ControlLoop, to_blocks: true do
  parts = <<-EOS
loop do

end
  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="control_loop" />
      XML
    end
  end

  parts = <<-EOS
loop do
  puts "Hello, World!"
end
  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="control_loop">
            <statement name="DO">
              <block type="ruby_statement">
                <field name="STATEMENT">puts &quot;Hello, World!&quot;</field>
              </block>
            </statement>
          </block>
      XML
    end
  end

  _data = <<-EOS
loop do

end
  EOS
  describe compact_source_code(_data) do
    __data = _data
    let(:data) { __data }

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

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
smalruby-editor-0.4.1-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.4.2-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.4.2 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.4.1 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.4.0-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.4.0 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.5-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.5 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.4-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.4 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.3-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.3 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.2-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.2 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.1-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.1 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.0-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.3.0 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.2.7-x86-mingw32 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb
smalruby-editor-0.2.7 spec/models/concerns/ruby_to_block/block/control_loop_spec.rb