Sha256: 281d3250a61be14812ec611044ec8309b0b9746fbd7455b7bc041e5d6d5dd5cc

Contents?: true

Size: 833 Bytes

Versions: 3

Compression:

Stored size: 833 Bytes

Contents

require 'rdf/spec'

share_as :RDF_Value do
  before :each do
    raise '+@value+ must be defined in a before(:each) block' unless instance_variable_get('@value')
    raise '+@resource+ must be defined in a before(:each) block' unless instance_variable_get('@resource')
  end

  describe RDF::Value do
    it "should not be instantiable" do
      lambda { @value.call }.should raise_error(NoMethodError)
    end
  end

  describe RDF::Resource do
    it "should instantiate blank nodes" do
      resource = @resource.call('_:foobar')
      resource.class.should == RDF::Node
      resource.id.should == 'foobar'
    end

    it "should instantiate URIs" do
      resource = @resource.call('http://rdf.rubyforge.org/')
      resource.class.should == RDF::URI
      resource.to_s.should == 'http://rdf.rubyforge.org/'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rdf-spec-0.3.2 lib/rdf/spec/value.rb
rdf-spec-0.3.1 lib/rdf/spec/value.rb
rdf-spec-0.3.0 lib/rdf/spec/value.rb