Sha256: 28413b6c2f29b4909291c495804f7953c2a623ff3007e1961d4dd94de458b24e
Contents?: true
Size: 1.12 KB
Versions: 18
Compression:
Stored size: 1.12 KB
Contents
module ParserExampleGroup def load_part(path) Whois::Record::Part.new(File.read(fixture("responses", @host.to_s, @suffix.to_s, @schema.to_s, path)), @host) end def _part Whois::Record::Part end def _registrar Whois::Record::Registrar end def _contact Whois::Record::Contact end def _nameserver Whois::Record::Nameserver end end RSpec::Matchers.define :cache_property do |property| match do |instance| cache = instance.instance_eval do @cached_properties = {} @cached_properties end cache.key?(property).should be_false value = instance.send(property) cache.key?(property).should be_true cache[property].should == value true end failure_message_for_should do |instance| "expected parser to cache property #{property}" end failure_message_for_should_not do |instance| "expected parser to not cache property #{property}" end end RSpec::configure do |c| def c.escaped_path(*parts) /#{parts.join('\/')}/ end c.include ParserExampleGroup, :example_group => { :file_path => c.escaped_path(%w( spec whois record parser )) } end
Version data entries
18 entries across 18 versions & 1 rubygems