Sha256: 8440bfc0c739f73eb8d6ef3ae276e34b7a8d4d54a495e41d1b2dd65c318b4dcb

Contents?: true

Size: 940 Bytes

Versions: 2

Compression:

Stored size: 940 Bytes

Contents

require 'rdf/spec'

RSpec.shared_examples 'an RDF::Readable' do
  include RDF::Spec::Matchers

  before do
    raise 'readable must be defined in with let(:readable)' unless
      defined? readable
  end

  describe RDF::Readable do
    subject { readable }
    it { is_expected.to respond_to :readable? }
    it { is_expected.to respond_to :readable? }
    its(:readable?) { is_expected.to eq subject.readable? }
  end
end

##
# @deprecated use `it_behaves_like "an RDF::Readable"` instead
module RDF_Readable
  extend RSpec::SharedContext
  include RDF::Spec::Matchers

  def self.included(mod)
    warn "[DEPRECATION] `RDF_Readable` is deprecated. "\
         "Please use `it_behaves_like 'an RDF::Readable'`"
  end

  describe 'examples for' do
    include_examples 'an RDF::Readable' do
      let(:readable) { @readable }

      before do
        raise '@readable must be defined' unless defined?(readable)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rdf-spec-1.99.0 lib/rdf/spec/readable.rb
rdf-spec-1.1.13 lib/rdf/spec/readable.rb