Sha256: 53cce9d3160ef98cfd721c945f35ffbb4140ef10e39e24bcccff5aa51b7564f7

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

module LogicalConstruct
  module Testing
    def self.stub_resolution(resolver, fulfillment)
      resolver.instance_eval do
        define_method :action do
          fulfillment.each_pair do |key, value|
            prereq = prerequisite_tasks.find do |task|
              task.name == key
            end

            if prereq.nil?
              raise "No prerequisite task named #{key}"
            else
              prereq.fulfill(value)
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
logical-construct-0.1.0 spec_help/mock-resolve.rb
logical-construct-0.0.5 spec_help/mock-resolve.rb
logical-construct-0.0.4 spec_help/mock-resolve.rb
logical-construct-0.0.3 spec_help/mock-resolve.rb
logical-construct-0.0.2 spec_help/mock-resolve.rb
logical-construct-0.0.1 spec_help/mock-resolve.rb
logical-construct-0.0.1.localtesting spec_help/mock-resolve.rb