spec/fetcher/microdata/article_small_spec.rb in fetcher-microdata-0.0.7 vs spec/fetcher/microdata/article_small_spec.rb in fetcher-microdata-0.0.8

- old
+ new

@@ -1,11 +1,12 @@ require 'spec_helper' describe Fetcher::Microdata::ArticleSmall do describe '.new' do it 'should set the _type to schema.org/Article/Small' do - article = Fetcher::Microdata::ArticleSmall.new @argument, @viewer + @arg = stub "arg" + article = Fetcher::Microdata::ArticleSmall.new @arg, @argument, @viewer article._type.should == "http://schema.org/Article/Small" end end it 'should raise wrong number of argument if the count of arguments is distinct of 3' do @@ -18,49 +19,52 @@ Fetcher::Microdata::ArticleSmall.superclass.should == Fetcher::Microdata end describe 'attributes' do before do + @arg1 = stub "args1" + @arg2 = stub "args2" + @arg3 = stub "args3" Fetcher::Microdata::ArticleSmall.any_instance.stub :coerce end it 'should set attribute additionalType' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :additionalType end it 'should set attribute id' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :id end it 'should set attribute articleBody' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :articleBody end it 'should set attribute author' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :author end it 'should set attribute viewer' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :viewer end it 'should set attribute dateCreated' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :dateCreated end it 'should set attribute provider' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :provider end it 'should set attribute url' do - Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub) + Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3) .attributes.should have_key :url end end end \ No newline at end of file