Sha256: 98a53f7699e4b2f2822878955335c35e93bd44137123d19abcc31f4c6b286d1f
Contents?: true
Size: 762 Bytes
Versions: 17
Compression:
Stored size: 762 Bytes
Contents
module Prospectus ## # Define list object that contains items class List def initialize(params = {}) @options = params end def items @items ||= [] end def check all, good_only = @options.values_at(:all, :good_only) items.select do |x| match = x.expected == x.actual true if all || (!match ^ good_only) end end end ## # DSL for wrapping eval of list files class ListDSL def initialize(list, params) @list = list @options = params end def item(&block) item = Item.new(@options) dsl = ItemDSL.new(item, @options) dsl.instance_eval(&block) @list.items << item item.list.items.each { |x| @list.items << x } end end end
Version data entries
17 entries across 17 versions & 1 rubygems