Sha256: 77ad1df46401ebcdfbbcb31a0342ae10d82e9215ddea38e025360eb934df565c

Contents?: true

Size: 1.63 KB

Versions: 6

Compression:

Stored size: 1.63 KB

Contents

require 'spec_helper'

describe Fetcher::Microdata::PersonUser do 
  describe '.new' do
    it 'should set the _type to schema.org/Person/User' do
      @arg = stub "arg"
      person = Fetcher::Microdata::PersonUser.new @arg, @argument
      person._type.should == "http://schema.org/Person/User"
    end
  end

  it 'should inherit from Fetcher::Microdata' do 
    Fetcher::Microdata::PersonUser.superclass.should == Fetcher::Microdata
  end

  it 'should raise wrong number of argument if the count of arguments is distinct of 2' do
    expect {
      Fetcher::Microdata::PersonUser.new "a", "b", "c"
    }.to raise_error
  end

  describe 'attributes' do
    before do 
      @arg1 = stub "arg1"
      @arg2 = stub "arg2"
    end

    it 'should have the attribute additionalType' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :additionalType
    end

    it 'should have the attribute id' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :id
    end    

    it 'should have the attribute name' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :name
    end        

    it 'should have the attribute dateRegistered' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :dateRegistered
    end        

    it 'should have the attribute description' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :description
    end        

    it 'should have the attribute url' do 
      Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :url
    end        
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fetcher-microdata-0.0.13 spec/fetcher/microdata/person_user_spec.rb
fetcher-microdata-0.0.12 spec/fetcher/microdata/person_user_spec.rb
fetcher-microdata-0.0.11 spec/fetcher/microdata/person_user_spec.rb
fetcher-microdata-0.0.10 spec/fetcher/microdata/person_user_spec.rb
fetcher-microdata-0.0.9 spec/fetcher/microdata/person_user_spec.rb
fetcher-microdata-0.0.8 spec/fetcher/microdata/person_user_spec.rb