fetcher-microdata 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fetcher-microdata/article_small.rb +2 -2
- data/lib/fetcher-microdata/person_user.rb +2 -2
- data/lib/fetcher-microdata/review.rb +2 -2
- data/lib/fetcher-microdata/version.rb +1 -1
- data/spec/fetcher/microdata/article_small_spec.rb +3 -3
- data/spec/fetcher/microdata/person_user_spec.rb +1 -1
- data/spec/fetcher/microdata/review_spec.rb +2 -2
- metadata +1 -1
@@ -3,10 +3,10 @@ module Fetcher
|
|
3
3
|
class ArticleSmall < Fetcher::Microdata
|
4
4
|
|
5
5
|
def initialize *args
|
6
|
-
if args.length ==
|
6
|
+
if args.length == 3
|
7
7
|
super *args
|
8
8
|
else
|
9
|
-
raise ArgumentError, "Wrong number of arguments #{args.length} and
|
9
|
+
raise ArgumentError, "Wrong number of arguments #{args.length} and 3 needed"
|
10
10
|
end
|
11
11
|
@_type = "http://schema.org/Article/Small"
|
12
12
|
end
|
@@ -3,10 +3,10 @@ module Fetcher
|
|
3
3
|
class PersonUser < Fetcher::Microdata
|
4
4
|
|
5
5
|
def initialize *args
|
6
|
-
if args.length ==
|
6
|
+
if args.length == 2
|
7
7
|
super *args
|
8
8
|
else
|
9
|
-
raise ArgumentError, "Wrong number of arguments #{args.length} and
|
9
|
+
raise ArgumentError, "Wrong number of arguments #{args.length} and 2 needed"
|
10
10
|
end
|
11
11
|
@_type = 'http://schema.org/Person/User'
|
12
12
|
end
|
@@ -3,10 +3,10 @@ module Fetcher
|
|
3
3
|
class Review < Fetcher::Microdata
|
4
4
|
|
5
5
|
def initialize *args
|
6
|
-
if args.length ==
|
6
|
+
if args.length == 3
|
7
7
|
super *args
|
8
8
|
else
|
9
|
-
raise ArgumentError, "Wrong number of arguments #{args.length} and
|
9
|
+
raise ArgumentError, "Wrong number of arguments #{args.length} and 3 needed"
|
10
10
|
end
|
11
11
|
@_type = "http://schema.org/Review"
|
12
12
|
end
|
@@ -8,12 +8,12 @@ describe Fetcher::Microdata::ArticleSmall do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
it 'should raise wrong number of argument if the count of arguments is distinct of
|
11
|
+
it 'should raise wrong number of argument if the count of arguments is distinct of 3' do
|
12
12
|
expect {
|
13
|
-
Fetcher::Microdata::ArticleSmall.new "a", "b", "c"
|
13
|
+
Fetcher::Microdata::ArticleSmall.new "a", "b", "c", "d"
|
14
14
|
}.to raise_error
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
it 'should inherit from Fetcher::Microdata' do
|
18
18
|
Fetcher::Microdata::ArticleSmall.superclass.should == Fetcher::Microdata
|
19
19
|
end
|
@@ -12,7 +12,7 @@ describe Fetcher::Microdata::PersonUser do
|
|
12
12
|
Fetcher::Microdata::PersonUser.superclass.should == Fetcher::Microdata
|
13
13
|
end
|
14
14
|
|
15
|
-
it 'should raise wrong number of argument if the count of arguments is distinct of
|
15
|
+
it 'should raise wrong number of argument if the count of arguments is distinct of 2' do
|
16
16
|
expect {
|
17
17
|
Fetcher::Microdata::PersonUser.new "a", "b", "c"
|
18
18
|
}.to raise_error
|
@@ -12,9 +12,9 @@ describe Fetcher::Microdata::Review do
|
|
12
12
|
Fetcher::Microdata::Review.superclass.should == Fetcher::Microdata
|
13
13
|
end
|
14
14
|
|
15
|
-
it 'should raise wrong number of argument if the count of arguments is distinct of
|
15
|
+
it 'should raise wrong number of argument if the count of arguments is distinct of 3' do
|
16
16
|
expect {
|
17
|
-
Fetcher::Microdata::Review.new "a", "b", "c"
|
17
|
+
Fetcher::Microdata::Review.new "a", "b", "c", "d"
|
18
18
|
}.to raise_error
|
19
19
|
end
|
20
20
|
|