Sha256: 46d33b861d190ffffb100c352634f3c5ca63148e0648e012058fbf1357ca01f3
Contents?: true
Size: 638 Bytes
Versions: 13
Compression:
Stored size: 638 Bytes
Contents
require "test_helper" class InheritanceTest < Minitest::Spec Song = Struct.new(:id, :title, :length) do def self.find_by(options); options[:id].nil? ? nil : new(options[:id]) end end class Create < Trailblazer::Operation self["a"] = "A" self["b"] = "B" self["c"] = "D" def self.class(*skills) Class.new(Trailblazer::Operation). tap do |klass| skills.each { |skill| klass.heritage.record(:[]=, skill, self[skill]) } end end end class Update < Create.class("a", "b") end it do Update["a"].must_equal "A" Update["b"].must_equal "B" Update["c"].must_be_nil end end
Version data entries
13 entries across 13 versions & 1 rubygems