Sha256: a189009cf53f8bde97342dee28e9c499e328cbb636d205379a6ab1c52943f1c5
Contents?: true
Size: 944 Bytes
Versions: 63
Compression:
Stored size: 944 Bytes
Contents
shared_context ':to_blocks', to_blocks: true do let(:source_code) { SourceCode.new(data: data) } subject { source_code.to_blocks } end shared_context ':character_new_data', character_new_data: true do let(:data) { <<-EOS.strip_heredoc require "smalruby" car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0) #{parts} EOS } end shared_context ':on_start_data', on_start_data: true do let(:data) { <<-EOS.strip_heredoc require "smalruby" car1 = Character.new(costume: "car1.png", x: 0, y: 0, angle: 0) car1.on(:start) do #{parts.lines.join(' ')} end EOS } end class EqBlockXml < RSpec::Matchers::BuiltIn::Eq def matches?(actual) indent = @expected.slice(/\A(\s*).*$/, 1).length re = /\A {#{indent},}/ @actual = actual.lines.select { |l| re.match(l) }.join @actual = actual if @actual.empty? match(@expected, @actual) end end def eq_block_xml(xml) EqBlockXml.new(xml) end
Version data entries
63 entries across 63 versions & 1 rubygems