Sha256: 6f0692e5b6a4dec8c7dcaf7a64c524fed008d094cf6e5582fe2e2cdffe7a1ac5
Contents?: true
Size: 641 Bytes
Versions: 1
Compression:
Stored size: 641 Bytes
Contents
require 'struct_trans/test' describe 'from README.md' do readme = File.read("#{__dir__}/../README.md") codes = readme.scan(/``` ruby(.+?)```/m).map(&:first) Context = Class.new{ def results; @results ||= []; end def p res ; results << res ; end def verify expects results.zip(expects).each do |(res, exp)| res.should.eq instance_eval(exp) end end } codes.each.with_index do |code, index| would 'pass from README.md #%02d' % index do context = Context.new context.instance_eval(code, 'README.md', 0) context.verify(code.scan(/# (.+)/).map(&:first)) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
struct_trans-0.5.0 | test/test_from_readme.rb |