tdiary-contrib 4.0.2.1 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ describe "apple_webclip plugin" do
15
15
  end
16
16
 
17
17
  it "header include url" do
18
- @header_snippet.should == %Q|\t<link rel="apple-touch-icon" href="http://example.com/example.png">|
18
+ expect(@header_snippet).to eq(%Q|\t<link rel="apple-touch-icon" href="http://example.com/example.png">|)
19
19
  end
20
20
  end
21
21
 
@@ -27,7 +27,7 @@ describe "apple_webclip plugin" do
27
27
  end
28
28
 
29
29
  it "header is empty" do
30
- @header_snippet.should be_empty
30
+ expect(@header_snippet).to be_empty
31
31
  end
32
32
  end
33
33
 
@@ -38,7 +38,7 @@ describe "apple_webclip plugin" do
38
38
  end
39
39
 
40
40
  it "header is empty" do
41
- @header_snippet.should be_empty
41
+ expect(@header_snippet).to be_empty
42
42
  end
43
43
  end
44
44
  end
data/spec/gist_spec.rb CHANGED
@@ -11,6 +11,6 @@ describe "gist plugin" do
11
11
  <div class="gist_plugin"><script src="http://gist.github.com/1234567890.js"></script>
12
12
  <noscript><a href="http://gist.github.com/1234567890">gist:1234567890</a></noscript></div>
13
13
  EOS
14
- snippet.should == expected
14
+ expect(snippet).to eq(expected)
15
15
  end
16
16
  end
@@ -9,7 +9,7 @@ describe "github link plugin" do
9
9
  let(:args) { ['tdiary/tdiary-contrib'] }
10
10
 
11
11
  it 'should render repository a tag' do
12
- should == %(<a href='https://github.com/tdiary/tdiary-contrib'>tdiary-contrib</a>)
12
+ is_expected.to eq(%(<a href='https://github.com/tdiary/tdiary-contrib'>tdiary-contrib</a>))
13
13
  end
14
14
  end
15
15
 
@@ -17,7 +17,7 @@ describe "github link plugin" do
17
17
  let(:args) { ['tdiary/tdiary-contrib#100'] }
18
18
 
19
19
  it 'should render issues a tag' do
20
- should == %(<a href='https://github.com/tdiary/tdiary-contrib/issues/100'>tdiary-contrib#100</a>)
20
+ is_expected.to eq(%(<a href='https://github.com/tdiary/tdiary-contrib/issues/100'>tdiary-contrib#100</a>))
21
21
  end
22
22
  end
23
23
  context "When given altenative text" do
@@ -26,13 +26,13 @@ describe "github link plugin" do
26
26
  let(:args) { [github_identifier, text] }
27
27
 
28
28
  it 'should render repository a tag with the specified text' do
29
- should == %(<a href='https://github.com/#{github_identifier}'>#{text}</a>)
29
+ is_expected.to eq(%(<a href='https://github.com/#{github_identifier}'>#{text}</a>))
30
30
  end
31
31
  context "but the text is including <script>" do
32
32
  let(:text) { '<script>alert("hoge");</script>' }
33
33
 
34
34
  it 'should render a link text after sanitizing.' do
35
- should_not == %(<a href='https://github.com/#{github_identifier}'>#{text}</a>)
35
+ is_expected.not_to eq(%(<a href='https://github.com/#{github_identifier}'>#{text}</a>))
36
36
  end
37
37
  end
38
38
  end
@@ -16,7 +16,7 @@ describe "google_analytics plugin" do
16
16
 
17
17
  it "for footer" do
18
18
  snippet = @plugin.footer_proc
19
- snippet.should == expected_html_footer_snippet
19
+ expect(snippet).to eq(expected_html_footer_snippet)
20
20
  end
21
21
  end
22
22
 
@@ -27,7 +27,7 @@ describe "google_analytics plugin" do
27
27
 
28
28
  it "for footer" do
29
29
  snippet = @plugin.footer_proc
30
- snippet.should be_empty
30
+ expect(snippet).to be_empty
31
31
  end
32
32
  end
33
33
 
@@ -38,7 +38,7 @@ describe "google_analytics plugin" do
38
38
 
39
39
  it "for footer" do
40
40
  snippet = @plugin.footer_proc
41
- snippet.should be_empty
41
+ expect(snippet).to be_empty
42
42
  end
43
43
  end
44
44
 
data/spec/jdate_spec.rb CHANGED
@@ -14,7 +14,7 @@ describe "jdate plugin" do
14
14
  '20080126' => '土',
15
15
  '20080127' => '日',
16
16
  }.each do |k,v|
17
- it { setup_jdate_plugin(Time.parse(k)).date.strftime('%J').should == v }
17
+ it { expect(setup_jdate_plugin(Time.parse(k)).date.strftime('%J')).to eq(v) }
18
18
  end
19
19
 
20
20
  def setup_jdate_plugin(date)
data/spec/jmonth_spec.rb CHANGED
@@ -19,7 +19,7 @@ describe "jmonth plugin" do
19
19
  '2007/11/01' => '霜月',
20
20
  '2007/12/01' => '師走'
21
21
  }.each do |k,v|
22
- it { setup_jmonth_plugin(Time.parse(k)).date.strftime('%i').should == v }
22
+ it { expect(setup_jmonth_plugin(Time.parse(k)).date.strftime('%i')).to eq(v) }
23
23
  end
24
24
 
25
25
  def setup_jmonth_plugin(date)
data/spec/jyear_spec.rb CHANGED
@@ -12,7 +12,7 @@ describe "jyear plugin" do
12
12
  '1989/01/08' => '平成元年',
13
13
  '1990/01/01' => '平成2',
14
14
  }.each do |k,v|
15
- it { setup_jyear_plugin(Time.parse(k)).date.strftime('%K').should == v }
15
+ it { expect(setup_jyear_plugin(Time.parse(k)).date.strftime('%K')).to eq(v) }
16
16
  end
17
17
 
18
18
  def setup_jyear_plugin(date)
@@ -29,17 +29,17 @@ describe "MyHotEntry" do
29
29
  end
30
30
 
31
31
  it "キャッシュファイルが生成されていること" do
32
- File.should be_file(@dbfile)
32
+ expect(File).to be_file(@dbfile)
33
33
  end
34
34
 
35
35
  it "人気の日記が取得できていること" do
36
- @entries.size.should > 0
36
+ expect(@entries.size).to be > 0
37
37
  end
38
38
 
39
39
  it "取得したエントリにbase_urlとタイトルが含まれていること" do
40
40
  @entries.each do |entry|
41
- entry[:url].should be_include(@base_url)
42
- entry[:title].size.should > 0
41
+ expect(entry[:url]).to be_include(@base_url)
42
+ expect(entry[:title].size).to be > 0
43
43
  end
44
44
  end
45
45
  end
@@ -53,7 +53,7 @@ describe "MyHotEntry" do
53
53
  end
54
54
 
55
55
  it "キャッシュサイズが大きくならないこと" do
56
- @entry_size.should == @original_entry_size
56
+ expect(@entry_size).to eq(@original_entry_size)
57
57
  end
58
58
  end
59
59
 
@@ -65,14 +65,14 @@ describe "MyHotEntry" do
65
65
 
66
66
  it "キャッシュをクリアしないこと" do
67
67
  @hotentry.update(@empty_url)
68
- @hotentry.entries.size.should == 0
68
+ expect(@hotentry.entries.size).to eq(0)
69
69
 
70
70
  @hotentry.update(@exist_url)
71
- @hotentry.entries.size.should > 0
71
+ expect(@hotentry.entries.size).to be > 0
72
72
  exist_size = @hotentry.entries.size
73
73
 
74
74
  @hotentry.update(@empty_url)
75
- @hotentry.entries.size.should == exist_size
75
+ expect(@hotentry.entries.size).to eq(exist_size)
76
76
  end
77
77
  end
78
78
  end
data/spec/openid_spec.rb CHANGED
@@ -16,11 +16,11 @@ describe "openid plugin w/" do
16
16
  @header_snippet = plugin.header_proc
17
17
  end
18
18
 
19
- it { @header_snippet.should include_link_tag_with(
19
+ it { expect(@header_snippet).to include_link_tag_with(
20
20
  :rel => 'openid.server',
21
21
  :href => 'https://www.hatena.ne.jp/openid/server')}
22
22
 
23
- it { @header_snippet.should include_link_tag_with(
23
+ it { expect(@header_snippet).to include_link_tag_with(
24
24
  :rel => 'openid.delegate',
25
25
  :href => 'http://www.hatena.ne.jp/tdtds/')}
26
26
  end
@@ -31,11 +31,11 @@ describe "openid plugin w/" do
31
31
  @header_snippet = plugin.header_proc
32
32
  end
33
33
 
34
- it { @header_snippet.should include_link_tag_with(
34
+ it { expect(@header_snippet).to include_link_tag_with(
35
35
  :rel => 'openid.server',
36
36
  :href => 'http://auth.livedoor.com/openid/server')}
37
37
 
38
- it { @header_snippet.should include_link_tag_with(
38
+ it { expect(@header_snippet).to include_link_tag_with(
39
39
  :rel => 'openid.delegate',
40
40
  :href => 'http://profile.livedoor.com/tdtds')}
41
41
  end
@@ -46,11 +46,11 @@ describe "openid plugin w/" do
46
46
  @header_snippet = plugin.header_proc
47
47
  end
48
48
 
49
- it { @header_snippet.should include_link_tag_with(
49
+ it { expect(@header_snippet).to include_link_tag_with(
50
50
  :rel => 'openid.server',
51
51
  :href => 'http://www.livejournal.com/openid/server.bml')}
52
52
 
53
- it { @header_snippet.should include_link_tag_with(
53
+ it { expect(@header_snippet).to include_link_tag_with(
54
54
  :rel => 'openid.delegate',
55
55
  :href => 'http://tdtds.livejournal.com/')}
56
56
 
@@ -62,15 +62,15 @@ describe "openid plugin w/" do
62
62
  @header_snippet = plugin.header_proc
63
63
  end
64
64
 
65
- it { @header_snippet.should include_link_tag_with(
65
+ it { expect(@header_snippet).to include_link_tag_with(
66
66
  :rel => 'openid.server',
67
67
  :href => 'http://www.openid.ne.jp/user/auth')}
68
68
 
69
- it { @header_snippet.should include_link_tag_with(
69
+ it { expect(@header_snippet).to include_link_tag_with(
70
70
  :rel => 'openid.delegate',
71
71
  :href => 'http://tdtds.openid.ne.jp')}
72
72
 
73
- it { @header_snippet.should include_xrds_meta_tag_with(
73
+ it { expect(@header_snippet).to include_xrds_meta_tag_with(
74
74
  :content => 'http://tdtds.openid.ne.jp/user/xrds')}
75
75
 
76
76
  end
@@ -81,11 +81,11 @@ describe "openid plugin w/" do
81
81
  @header_snippet = plugin.header_proc
82
82
  end
83
83
 
84
- it { @header_snippet.should include_link_tag_with(
84
+ it { expect(@header_snippet).to include_link_tag_with(
85
85
  :rel => 'openid.server',
86
86
  :href => 'http://www.typekey.com/t/openid/')}
87
87
 
88
- it { @header_snippet.should include_link_tag_with(
88
+ it { expect(@header_snippet).to include_link_tag_with(
89
89
  :rel => 'openid.delegate',
90
90
  :href => 'http://profile.typekey.com/tdtds/')}
91
91
 
@@ -97,11 +97,11 @@ describe "openid plugin w/" do
97
97
  @header_snippet = plugin.header_proc
98
98
  end
99
99
 
100
- it { @header_snippet.should include_link_tag_with(
100
+ it { expect(@header_snippet).to include_link_tag_with(
101
101
  :rel => 'openid.server',
102
102
  :href => 'http://www.vox.com/services/openid/server')}
103
103
 
104
- it { @header_snippet.should include_link_tag_with(
104
+ it { expect(@header_snippet).to include_link_tag_with(
105
105
  :rel => 'openid.delegate',
106
106
  :href => 'http://tdtds.vox.com/')}
107
107
  end
@@ -112,22 +112,22 @@ describe "openid plugin w/" do
112
112
  @header_snippet = @plugin.header_proc
113
113
  end
114
114
 
115
- it { @header_snippet.should include_xrds_meta_tag_with(
115
+ it { expect(@header_snippet).to include_xrds_meta_tag_with(
116
116
  :content => "http://www.myopenid.com/xrds?username=tdtds")}
117
117
 
118
- it { @header_snippet.should include_link_tag_with(
118
+ it { expect(@header_snippet).to include_link_tag_with(
119
119
  :rel => "openid.server",
120
120
  :href => "http://www.myopenid.com/server")}
121
121
 
122
- it { @header_snippet.should include_link_tag_with(
122
+ it { expect(@header_snippet).to include_link_tag_with(
123
123
  :rel => "openid.delegate",
124
124
  :href => "http://tdtds.myopenid.com")}
125
125
 
126
- it { @header_snippet.should include_link_tag_with(
126
+ it { expect(@header_snippet).to include_link_tag_with(
127
127
  :rel => "openid2.provider",
128
128
  :href => "http://www.myopenid.com/server")}
129
129
 
130
- it { @header_snippet.should include_link_tag_with(
130
+ it { expect(@header_snippet).to include_link_tag_with(
131
131
  :rel => "openid2.local_id",
132
132
  :href => "http://tdtds.myopenid.com")}
133
133
  end
@@ -138,14 +138,14 @@ describe "openid plugin w/" do
138
138
  @header_snippet = @plugin.header_proc
139
139
  end
140
140
 
141
- it { @header_snippet.should include_xrds_meta_tag_with(
141
+ it { expect(@header_snippet).to include_xrds_meta_tag_with(
142
142
  :content => "http://claimid.com/tdtds/xrds")}
143
143
 
144
- it { @header_snippet.should include_link_tag_with(
144
+ it { expect(@header_snippet).to include_link_tag_with(
145
145
  :rel => "openid.server",
146
146
  :href => "http://openid.claimid.com/server")}
147
147
 
148
- it { @header_snippet.should include_link_tag_with(
148
+ it { expect(@header_snippet).to include_link_tag_with(
149
149
  :rel => "openid.delegate",
150
150
  :href => "http://openid.claimid.com/tdtds")}
151
151
  end
@@ -156,22 +156,22 @@ describe "openid plugin w/" do
156
156
  @header_snippet = @plugin.header_proc
157
157
  end
158
158
 
159
- it { @header_snippet.should include_xrds_meta_tag_with(
159
+ it { expect(@header_snippet).to include_xrds_meta_tag_with(
160
160
  :content => "http://pip.verisignlabs.com/user/tdtds/yadisxrds")}
161
161
 
162
- it { @header_snippet.should include_link_tag_with(
162
+ it { expect(@header_snippet).to include_link_tag_with(
163
163
  :rel => "openid.server",
164
164
  :href => "http://pip.verisignlabs.com/server")}
165
165
 
166
- it { @header_snippet.should include_link_tag_with(
166
+ it { expect(@header_snippet).to include_link_tag_with(
167
167
  :rel => "openid.delegate",
168
168
  :href => "http://tdtds.pip.verisignlabs.com/")}
169
169
 
170
- it { @header_snippet.should include_link_tag_with(
170
+ it { expect(@header_snippet).to include_link_tag_with(
171
171
  :rel => "openid2.provider",
172
172
  :href => "http://pip.verisignlabs.com/server")}
173
173
 
174
- it { @header_snippet.should include_link_tag_with(
174
+ it { expect(@header_snippet).to include_link_tag_with(
175
175
  :rel => "openid2.local_id",
176
176
  :href => "http://tdtds.pip.verisignlabs.com/")}
177
177
  end
@@ -182,18 +182,18 @@ describe "openid plugin w/" do
182
182
  @header_snippet = plugin.header_proc
183
183
  end
184
184
 
185
- it { @header_snippet.should include_link_tag_with(
185
+ it { expect(@header_snippet).to include_link_tag_with(
186
186
  :rel => 'openid2.provider',
187
187
  :href => 'https://open.login.yahooapis.jp/openid/op/auth')}
188
188
 
189
- it { @header_snippet.should include_link_tag_with(
189
+ it { expect(@header_snippet).to include_link_tag_with(
190
190
  :rel => 'openid2.local_id',
191
191
  :href => 'https://me.yahoo.co.jp/a/tdtds')}
192
192
 
193
- it { @header_snippet.should_not include_link_tag_with(
193
+ it { expect(@header_snippet).not_to include_link_tag_with(
194
194
  :rel => "openid.server")}
195
195
 
196
- it { @header_snippet.should_not include_link_tag_with(
196
+ it { expect(@header_snippet).not_to include_link_tag_with(
197
197
  :rel => "openid.delegate")}
198
198
 
199
199
  end
@@ -204,18 +204,18 @@ describe "openid plugin w/" do
204
204
  @header_snippet = plugin.header_proc
205
205
  end
206
206
 
207
- it { @header_snippet.should include_link_tag_with(
207
+ it { expect(@header_snippet).to include_link_tag_with(
208
208
  :rel => 'openid2.provider',
209
209
  :href => 'https://open.login.yahooapis.com/openid/op/auth')}
210
210
 
211
- it { @header_snippet.should include_link_tag_with(
211
+ it { expect(@header_snippet).to include_link_tag_with(
212
212
  :rel => 'openid2.local_id',
213
213
  :href => 'https://me.yahoo.com/a/tdtds')}
214
214
 
215
- it { @header_snippet.should_not include_link_tag_with(
215
+ it { expect(@header_snippet).not_to include_link_tag_with(
216
216
  :rel => "openid.server")}
217
217
 
218
- it { @header_snippet.should_not include_link_tag_with(
218
+ it { expect(@header_snippet).not_to include_link_tag_with(
219
219
  :rel => "openid.delegate")}
220
220
  end
221
221
 
@@ -16,9 +16,9 @@ describe "opensearch_ad plugin w/" do
16
16
  @header_snippet = plugin.header_proc
17
17
  end
18
18
 
19
- it { @header_snippet.should == expected_link_tag_with(
19
+ it { expect(@header_snippet).to eq(expected_link_tag_with(
20
20
  :title => 'OpenSearch',
21
- :xml => 'http://example.com/opensearch.xml')}
21
+ :xml => 'http://example.com/opensearch.xml'))}
22
22
  end
23
23
 
24
24
  describe "in latest mode" do
@@ -27,9 +27,9 @@ describe "opensearch_ad plugin w/" do
27
27
  @header_snippet = plugin.header_proc
28
28
  end
29
29
 
30
- it { @header_snippet.should == expected_link_tag_with(
30
+ it { expect(@header_snippet).to eq(expected_link_tag_with(
31
31
  :title => 'OpenSearch',
32
- :xml => 'http://example.com/opensearch.xml')}
32
+ :xml => 'http://example.com/opensearch.xml'))}
33
33
  end
34
34
 
35
35
  describe "in edit mode" do
@@ -38,7 +38,7 @@ describe "opensearch_ad plugin w/" do
38
38
  @header_snippet = plugin.header_proc
39
39
  end
40
40
 
41
- it { @header_snippet.should be_empty }
41
+ it { expect(@header_snippet).to be_empty }
42
42
  end
43
43
 
44
44
  def expected_link_tag_with(options)
data/spec/profile_spec.rb CHANGED
@@ -7,7 +7,7 @@ describe "Profile::Service" do
7
7
  describe "GitHub" do
8
8
  before do
9
9
  require 'json'
10
- Profile::Service::GitHub.any_instance.stub(:fetch).and_return(JSON.parse(File.read("spec/fixtures/github.json")))
10
+ allow_any_instance_of(Profile::Service::GitHub).to receive(:fetch).and_return(JSON.parse(File.read("spec/fixtures/github.json")))
11
11
 
12
12
  # workaround for run spec on various environment.
13
13
  require 'openssl'
@@ -18,39 +18,39 @@ describe "Profile::Service" do
18
18
  end
19
19
 
20
20
  it "should include name, mail, image properties" do
21
- @profile.name.should == "Scott Chacon"
22
- @profile.mail.should == "schacon@gmail.com"
23
- @profile.image.should == "http://www.gravatar.com/avatar/9375a9529679f1b42b567a640d775e7d.jpg?s=40"
21
+ expect(@profile.name).to eq("Scott Chacon")
22
+ expect(@profile.mail).to eq("schacon@gmail.com")
23
+ expect(@profile.image).to eq("http://www.gravatar.com/avatar/9375a9529679f1b42b567a640d775e7d.jpg?s=40")
24
24
  end
25
25
  end
26
26
 
27
27
  describe "Twitter" do
28
28
  before do
29
- Profile::Service::Twitter.any_instance.stub(:fetch).and_return(REXML::Document.new(File.read("spec/fixtures/twitter.xml")))
29
+ allow_any_instance_of(Profile::Service::Twitter).to receive(:fetch).and_return(REXML::Document.new(File.read("spec/fixtures/twitter.xml")))
30
30
 
31
31
  # http://twitter.com/tdiary
32
32
  @profile = Profile::Service::Twitter.new("tdiary")
33
33
  end
34
34
 
35
35
  it "should include name, description, image properties" do
36
- @profile.name.should == "tDiary.org"
37
- @profile.description.should == "tDiaryオフィシャルアカウント"
38
- @profile.image.should match(%r{^http://.*\.(png|jpg)$})
36
+ expect(@profile.name).to eq("tDiary.org")
37
+ expect(@profile.description).to eq("tDiaryオフィシャルアカウント")
38
+ expect(@profile.image).to match(%r{^http://.*\.(png|jpg)$})
39
39
  end
40
40
  end
41
41
 
42
42
  describe "FriendFeed" do
43
43
  before do
44
- Profile::Service::FriendFeed.any_instance.stub(:fetch).and_return(REXML::Document.new(File.read("spec/fixtures/friendfeed.xml")))
44
+ allow_any_instance_of(Profile::Service::FriendFeed).to receive(:fetch).and_return(REXML::Document.new(File.read("spec/fixtures/friendfeed.xml")))
45
45
 
46
46
  # http://friendfeed.com/api/documentation#summary
47
47
  @profile = Profile::Service::FriendFeed.new("bret")
48
48
  end
49
49
 
50
50
  it "should include name, description, image properties" do
51
- @profile.name.should == "Bret Taylor"
52
- @profile.description.should == "Ex-CTO of Facebook. Previously co-founder and CEO of FriendFeed. Programmer, food lover."
53
- @profile.image.should == "http://friendfeed-api.com/v2/picture/bret"
51
+ expect(@profile.name).to eq("Bret Taylor")
52
+ expect(@profile.description).to eq("Ex-CTO of Facebook. Previously co-founder and CEO of FriendFeed. Programmer, food lover.")
53
+ expect(@profile.image).to eq("http://friendfeed-api.com/v2/picture/bret")
54
54
  end
55
55
  end
56
56
 
@@ -62,7 +62,7 @@ describe "Profile::Service" do
62
62
  end
63
63
 
64
64
  it "should include image property" do
65
- @profile.image.should == "http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg"
65
+ expect(@profile.image).to eq("http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg")
66
66
  end
67
67
 
68
68
  context 'with options' do
@@ -71,7 +71,7 @@ describe "Profile::Service" do
71
71
  end
72
72
 
73
73
  it "should specify size option" do
74
- @profile.image.should == "http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?s=40"
74
+ expect(@profile.image).to eq("http://www.gravatar.com/avatar/3b3be63a4c2a439b013787725dfce802.jpg?s=40")
75
75
  end
76
76
  end
77
77
  end
@@ -82,7 +82,7 @@ describe "Profile::Service" do
82
82
  end
83
83
 
84
84
  it "should include image property" do
85
- @profile.image.should == "http://www.hatena.ne.jp/users/km/kmachu/profile.gif"
85
+ expect(@profile.image).to eq("http://www.hatena.ne.jp/users/km/kmachu/profile.gif")
86
86
  end
87
87
  end
88
88
  end