Sha256: 688264d513dd093bacde83a9b9231aa5cd776766eab8eca6b58e765ccc0d4a45
Contents?: true
Size: 794 Bytes
Versions: 6
Compression:
Stored size: 794 Bytes
Contents
require 'yaml' module Vcloud module Tools module Tester class TestParameters def initialize(user_params, fixture_params) raise "No user parameters received" if user_params.empty? @user_params = user_params @fixture_params = fixture_params define_attr_readers end private def define_attr_readers test_params = @user_params.merge(@fixture_params) # Use +send+ because +define_method+ is private test_params.each_key do |param| self.class.send(:define_method, param) { test_params[param] } end end def method_missing (method_name) raise "Method TestParameters##{method_name} not defined" end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems