Sha256: 9bbb0ac2608b1b6e413d366589051e636a3704feaffae2d8edd5eaab11b68e39
Contents?: true
Size: 829 Bytes
Versions: 17
Compression:
Stored size: 829 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe 'Matcher.extract_attribute' do Dir[File.join(File.dirname(__FILE__), 'extract_attribute_data', '*.yml')].sort.each do |path| context File.basename(path) do specs = YAML.safe_load(File.read(path), aliases: true) specs.each do |spec| context spec['name'] do if spec['pending'] pending spec['pending'].to_s end let(:document) do spec['document'] end let(:key) { spec['key'] } let(:actual) do Mongoid::Matcher.extract_attribute(document, key) end let(:expected) { spec.fetch('result') } it 'has the expected result' do actual.should == expected end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems