fetcher-microdata 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ module Fetcher
19
19
  attribute :dateCreated
20
20
  attribute :provider
21
21
  attribute :url
22
- attribute :original_tweet
22
+ attribute :itemReviewed
23
23
  end
24
24
  end
25
25
  end
@@ -1,5 +1,5 @@
1
1
  module Fetcher
2
2
  class Microdata
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
@@ -3,7 +3,8 @@ require 'spec_helper'
3
3
  describe Fetcher::Microdata::ArticleSmall do
4
4
  describe '.new' do
5
5
  it 'should set the _type to schema.org/Article/Small' do
6
- article = Fetcher::Microdata::ArticleSmall.new @argument, @viewer
6
+ @arg = stub "arg"
7
+ article = Fetcher::Microdata::ArticleSmall.new @arg, @argument, @viewer
7
8
  article._type.should == "http://schema.org/Article/Small"
8
9
  end
9
10
  end
@@ -20,46 +21,49 @@ describe Fetcher::Microdata::ArticleSmall do
20
21
 
21
22
  describe 'attributes' do
22
23
  before do
24
+ @arg1 = stub "args1"
25
+ @arg2 = stub "args2"
26
+ @arg3 = stub "args3"
23
27
  Fetcher::Microdata::ArticleSmall.any_instance.stub :coerce
24
28
  end
25
29
 
26
30
  it 'should set attribute additionalType' do
27
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
31
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
28
32
  .attributes.should have_key :additionalType
29
33
  end
30
34
 
31
35
  it 'should set attribute id' do
32
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
36
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
33
37
  .attributes.should have_key :id
34
38
  end
35
39
 
36
40
  it 'should set attribute articleBody' do
37
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
41
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
38
42
  .attributes.should have_key :articleBody
39
43
  end
40
44
 
41
45
  it 'should set attribute author' do
42
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
46
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
43
47
  .attributes.should have_key :author
44
48
  end
45
49
 
46
50
  it 'should set attribute viewer' do
47
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
51
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
48
52
  .attributes.should have_key :viewer
49
53
  end
50
54
 
51
55
  it 'should set attribute dateCreated' do
52
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
56
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
53
57
  .attributes.should have_key :dateCreated
54
58
  end
55
59
 
56
60
  it 'should set attribute provider' do
57
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
61
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
58
62
  .attributes.should have_key :provider
59
63
  end
60
64
 
61
65
  it 'should set attribute url' do
62
- Fetcher::Microdata::ArticleSmall.new(@argument_stub, @viewer_stub)
66
+ Fetcher::Microdata::ArticleSmall.new(@arg1, @arg2, @arg3)
63
67
  .attributes.should have_key :url
64
68
  end
65
69
  end
@@ -2,8 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  describe Fetcher::Microdata::PersonUser do
4
4
  describe '.new' do
5
- it 'should set the _type to schema.org/Person/User' do
6
- person = Fetcher::Microdata::PersonUser.new @argument
5
+ it 'should set the _type to schema.org/Person/User' do
6
+ @arg = stub "arg"
7
+ person = Fetcher::Microdata::PersonUser.new @arg, @argument
7
8
  person._type.should == "http://schema.org/Person/User"
8
9
  end
9
10
  end
@@ -20,31 +21,32 @@ describe Fetcher::Microdata::PersonUser do
20
21
 
21
22
  describe 'attributes' do
22
23
  before do
23
- @argument_stub = {}
24
+ @arg1 = stub "arg1"
25
+ @arg2 = stub "arg2"
24
26
  end
25
27
 
26
28
  it 'should have the attribute additionalType' do
27
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :additionalType
29
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :additionalType
28
30
  end
29
31
 
30
32
  it 'should have the attribute id' do
31
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :id
33
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :id
32
34
  end
33
35
 
34
36
  it 'should have the attribute name' do
35
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :name
37
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :name
36
38
  end
37
39
 
38
40
  it 'should have the attribute dateRegistered' do
39
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :dateRegistered
41
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :dateRegistered
40
42
  end
41
43
 
42
44
  it 'should have the attribute description' do
43
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :description
45
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :description
44
46
  end
45
47
 
46
48
  it 'should have the attribute url' do
47
- Fetcher::Microdata::PersonUser.new(@argument_stub).attributes.should have_key :url
49
+ Fetcher::Microdata::PersonUser.new(@arg1, @arg2).attributes.should have_key :url
48
50
  end
49
51
  end
50
52
  end
@@ -3,7 +3,8 @@ require 'spec_helper'
3
3
  describe Fetcher::Microdata::Review do
4
4
  describe '.new' do
5
5
  it 'should set the _type to schema.org/Review' do
6
- article = Fetcher::Microdata::Review.new @argument, @viewer
6
+ @arg = stub "arg"
7
+ article = Fetcher::Microdata::Review.new @arg, @argument, @viewer
7
8
  article._type.should == "http://schema.org/Review"
8
9
  end
9
10
  end
@@ -20,52 +21,55 @@ describe Fetcher::Microdata::Review do
20
21
 
21
22
  describe 'attributes' do
22
23
  before do
24
+ @arg1 = stub "args1"
25
+ @arg2 = stub "args2"
26
+ @arg3 = stub "args3"
23
27
  Fetcher::Microdata::Review.any_instance.stub :coerce
24
28
  end
25
29
 
26
30
  it 'should set attribute additionalType' do
27
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
31
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
28
32
  .attributes.should have_key :additionalType
29
33
  end
30
34
 
31
35
  it 'should set attribute id' do
32
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
36
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
33
37
  .attributes.should have_key :id
34
38
  end
35
39
 
36
40
  it 'should set attribute articleBody' do
37
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
38
- .attributes.should have_key :articleBody
41
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
42
+ .attributes.should have_key :reviewBody
39
43
  end
40
44
 
41
45
  it 'should set attribute author' do
42
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
46
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
43
47
  .attributes.should have_key :author
44
48
  end
45
49
 
46
50
  it 'should set attribute viewer' do
47
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
51
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
48
52
  .attributes.should have_key :viewer
49
53
  end
50
54
 
51
55
  it 'should set attribute dateCreated' do
52
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
56
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
53
57
  .attributes.should have_key :dateCreated
54
58
  end
55
59
 
56
60
  it 'should set attribute provider' do
57
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
61
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
58
62
  .attributes.should have_key :provider
59
63
  end
60
64
 
61
65
  it 'should set attribute url' do
62
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
66
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
63
67
  .attributes.should have_key :url
64
68
  end
65
69
 
66
70
  it 'should set attribute original_tweet' do
67
- Fetcher::Microdata::Review.new(@argument_stub, @viewer_stub)
68
- .attributes.should have_key :original_tweet
71
+ Fetcher::Microdata::Review.new(@arg1, @arg2, @arg3)
72
+ .attributes.should have_key :itemReviewed
69
73
  end
70
74
  end
71
75
  end
@@ -49,15 +49,15 @@ describe Writer::Fetcher::Microdata::Review do
49
49
  .and_return :id => 234536234, :author => @author_stub, :viewer => @viewer_stub
50
50
  end
51
51
 
52
- it 'should include the articleBody' do
52
+ it 'should include the itemReviewed' do
53
53
  @properties_hash = {
54
- "articleBody" => [
54
+ "itemReviewed" => [
55
55
  "some body"
56
56
  ]
57
57
  }
58
58
 
59
59
  @schema_stub.should_receive(:attributes)
60
- .and_return :articleBody => "some body", :author => @author_stub, :viewer => @viewer_stub
60
+ .and_return :itemReviewed => "some body", :author => @author_stub, :viewer => @viewer_stub
61
61
  end
62
62
 
63
63
  it 'should include the author' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetcher-microdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: