Sha256: b6f14b09f0ea28e423ef0052cfc153c1257d8cae1a22a57d87d4ce564ebdf8b8

Contents?: true

Size: 700 Bytes

Versions: 4

Compression:

Stored size: 700 Bytes

Contents

require 'rdf/spec'

module RDF_Indexable
  extend RSpec::SharedContext
  include RDF::Spec::Matchers

  before :each do
    raise '+@indexable+ must be defined in a before(:each) block' unless instance_variable_get('@indexable')
  end

  describe RDF::Indexable do
    subject {@indexable}
    it {should respond_to(:indexed?)}
    its(:indexed?) {should == subject.indexed?}
    it {should respond_to(:index!)}
  
    it "does not raise error on #index! if #indexed?" do
      lambda {subject.index!}.should_not raise_error if subject.indexed?
    end
  
    it "raises error on #index! if not #indexed?" do
      lambda {subject.index!}.should raise_error unless subject.indexed?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rdf-spec-1.1.0.p3 lib/rdf/spec/indexable.rb
rdf-spec-1.0.7 lib/rdf/spec/indexable.rb
rdf-spec-1.1.0.p2 lib/rdf/spec/indexable.rb
rdf-spec-1.0.6 lib/rdf/spec/indexable.rb