@@ -10,23 +10,26 @@ module RubyStackoverflow
1010 it 'should get questions' do
1111 VCR . use_cassette ( 'questions' ) do
1212 response = RubyStackoverflow . questions
13- response . data . is_a? ( Array ) . should be_truthy
14- response . data . last . respond_to? ( :answer_count ) . should be_truthy
13+ 14+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
15+ expect ( response . data . last . respond_to? ( :answer_count ) ) . to be_truthy
1516 end
1617 end
1718
1819 it 'should get questions by id' do
1920 VCR . use_cassette ( 'questions_by_ids' ) do
2021 response = RubyStackoverflow . questions_by_ids ( [ '19294359' ] )
21- response . data . is_a? ( Array ) . should be_truthy
22- response . data . last . respond_to? ( :answer_count ) . should be_truthy
22+ 23+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
24+ expect ( response . data . last . respond_to? ( :answer_count ) ) . to be_truthy
2325 end
2426 end
2527
2628 it 'should get answers of questions' do
2729 VCR . use_cassette ( 'questions_answers' ) do
2830 response = RubyStackoverflow . answers_of_questions ( [ '16067043' , '19401289' ] )
29- response . data . is_a? ( Array ) . should be_truthy
31+ 32+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
3033 expect ( response . data . last . answers . count ) . to eq ( 1 )
3134 expect ( response . data . first . answers . last . answer_id ) . to eq ( 19401432 )
3235 end
@@ -36,54 +39,61 @@ module RubyStackoverflow
3639 VCR . use_cassette ( 'questions_comments' ) do
3740 response = RubyStackoverflow . comments_of_questions ( [ '13804832' ] )
3841 data = response . data . last
39- response . data . is_a? ( Array ) . should be_truthy
40- data . respond_to? ( :comments ) . should be_truthy
42+ 43+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
44+ expect ( data . respond_to? ( :comments ) ) . to be_truthy
4145 expect ( data . comments . first . owner [ :user_id ] ) . to eq ( 87189 )
4246 end
4347 end
4448
4549 it 'should get linked questions' do
4650 VCR . use_cassette ( 'linked_questions' ) do
4751 response = RubyStackoverflow . linked_questions ( [ '13804832' ] )
48- response . data . is_a? ( Array ) . should be_truthy
52+ 53+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
4954 end
5055 end
5156
5257 it 'should get related questions' do
5358 VCR . use_cassette ( 'related_questions' ) do
5459 response = RubyStackoverflow . related_questions ( [ '13804832' ] )
55- response . data . is_a? ( Array ) . should be_truthy
60+ 61+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
5662 end
5763 end
5864
5965 it 'should get timeline questions' do
6066 VCR . use_cassette ( 'timeline_questions' ) do
6167 response = RubyStackoverflow . timeline_of_questions ( [ '13804832' , '16067043' ] )
6268 data = response . data . first
63- response . data . is_a? ( Array ) . should be_truthy
64- data . posts . first . respond_to? ( :timeline_type ) . should be_truthy
69+ 70+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
71+ expect ( data . posts . first . respond_to? ( :timeline_type ) ) . to be_truthy
6572 expect ( data . posts . first . timeline_type ) . to eq ( 'comment' )
6673 end
6774 end
6875
6976 it 'should get featured questions' do
7077 VCR . use_cassette ( 'featured_questions' ) do
7178 response = RubyStackoverflow . featured_questions ( { page : 1 , pagesize : 1 } )
72- response . data . is_a? ( Array ) . should be_truthy
79+ 80+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
7381 end
7482 end
7583
7684 it 'should get unanswered questions' do
7785 VCR . use_cassette ( 'unanswered_questions' ) do
7886 response = RubyStackoverflow . unanswered_questions ( { tagged :'rails' , pagesize : 1 , page : 1 } )
79- response . data . is_a? ( Array ) . should be_truthy
87+ 88+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
8089 end
8190 end
8291
8392 it 'should get noanswered questions' do
8493 VCR . use_cassette ( 'noanswered_questions' ) do
8594 response = RubyStackoverflow . noanswered_questions ( { tagged :'rails' , pagesize : 1 , page : 1 } )
86- response . data . is_a? ( Array ) . should be_truthy
95+ 96+ expect ( response . data . is_a? ( Array ) ) . to be_truthy
8797 end
8898 end
8999 end
0 commit comments