Sha256: e31d57def4ecdcaf1e7025ee85fb226c5e3dcbeee17fb67054bc4c9ff9cd50d9

Contents?: true

Size: 652 Bytes

Versions: 8

Compression:

Stored size: 652 Bytes

Contents

require 'spec_helper'

RSpec.describe ActiveTriples::Property do
  subject { described_class.new(options) }
  let(:options) do
    {
      :name => :title,
      :predicate => RDF::DC.title,
      :class_name => "Test"
    }
  end

  it "should create accessors for each passed option" do
    expect(subject.name).to eq :title
    expect(subject.predicate).to eq RDF::DC.title
    expect(subject.class_name).to eq "Test"
  end

  describe "#to_h" do
    it "should not return the property's name" do
      expect(subject.to_h).to eq (
        {
          :predicate => RDF::DC.title,
          :class_name => "Test"
        }
      )
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
active-triples-0.7.6 spec/active_triples/property_spec.rb
active-triples-0.7.5 spec/active_triples/property_spec.rb
active-triples-0.7.4 spec/active_triples/property_spec.rb
active-triples-0.7.3 spec/active_triples/property_spec.rb
active-triples-0.7.2 spec/active_triples/property_spec.rb
active-triples-0.7.1 spec/active_triples/property_spec.rb
active-triples-0.8.1 spec/active_triples/property_spec.rb
active-triples-0.8.0 spec/active_triples/property_spec.rb