dash-bees 0.21 → 0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,195 +1,214 @@
1
1
  require_relative "setup"
2
2
 
3
- test DashFu::Bee::GithubIssues do
4
- context "setup" do
5
- setup { source.setup "repo"=>"assaf/vanity" }
3
+ describe "GitHub Issues" do
4
+ testing :github_issues
6
5
 
7
- context "metric" do
8
- subject { source.metric }
6
+ describe "setup" do
7
+ before { source.setup "repo"=>"assaf/vanity" }
9
8
 
10
- should "use repository name" do
11
- assert_equal "Github Issues for assaf/vanity", subject.name
12
- end
9
+ it "should use repository name" do
10
+ assert_equal "GitHub issues for assaf/vanity", source.name
11
+ end
12
+
13
+ it "should set origin from repository name" do
14
+ assert_equal "assaf/vanity", source.origin[:text]
15
+ assert_equal "http://github.com/assaf/vanity", source.origin[:url]
16
+ end
17
+
18
+ it "should set icon to the octocat" do
19
+ assert_equal "http://dash-fu.com/images/sources/github.png", source.fields[ICON]
20
+ end
21
+
22
+ it "should accept repository URL" do
23
+ source.setup "repo"=>"http://github.com/assaf/vanity", "branch"=>"master"
24
+ assert_equal "GitHub issues for assaf/vanity", source.name
25
+ end
13
26
 
14
- should "measure totals" do
15
- assert subject.totals
27
+ describe "metric" do
28
+ it "should measure totals" do
29
+ assert source.metric.totals
16
30
  end
17
31
 
18
- should "capture open issues" do
19
- assert subject.columns.include?(id: "open", label: "Open issues")
32
+ it "should capture open issues" do
33
+ assert source.metric.columns.include?(id: "open", label: "Open issues")
20
34
  end
21
35
 
22
- should "capture closed issues" do
23
- assert subject.columns.include?(id: "closed", label: "Closed issues")
36
+ it "should capture closed issues" do
37
+ assert source.metric.columns.include?(id: "closed", label: "Closed issues")
24
38
  end
25
39
  end
26
40
  end
27
41
 
28
42
 
29
- context "validation" do
30
- should "raise error if repository name missing" do
31
- assert_raise(RuntimeError) { source.setup "repo"=>" " }
43
+ describe "validation" do
44
+ it "should raise error if repository name missing" do
45
+ assert_raises(RuntimeError) { source.setup "repo"=>" " }
32
46
  end
33
47
 
34
- should "raise error if repository name not user/repo" do
35
- assert_raise(RuntimeError) { source.setup "repo"=>"vanity" }
48
+ it "should raise error if repository name not user/repo" do
49
+ assert_raises(RuntimeError) { source.setup "repo"=>"vanity" }
36
50
  end
37
51
 
38
- should "allow alphanumeric, minus and underscore" do
52
+ it "should allow alphanumeric, minus and underscore" do
39
53
  source.setup "repo"=>"assaf/the-vanity_0"
40
54
  assert source.valid?
41
55
  end
42
56
 
43
- should "create valid source" do
57
+ it "should create valid source" do
44
58
  source.setup "repo"=>"assaf/vanity"
45
59
  assert source.valid?
46
60
  end
47
61
  end
48
62
 
49
63
 
50
- context "update" do
51
- setup { source.setup "repo"=>"assaf/vanity" }
64
+ describe "update" do
65
+ before { source.setup "repo"=>"assaf/vanity" }
52
66
 
53
- should "handle 404" do
67
+ it "should handle 404" do
54
68
  stub_request(:get, interactions.first.uri).to_return status: 404
55
69
  stub_request(:get, interactions.second.uri).to_return status: 404
56
70
  source.update
57
71
  assert_equal "Could not find the repository assaf/vanity", source.last_error
58
72
  end
59
73
 
60
- should "handle 401" do
74
+ it "should handle 401" do
61
75
  stub_request(:get, interactions.first.uri).to_return status: 401
62
76
  stub_request(:get, interactions.second.uri).to_return status: 401
63
77
  source.update
64
78
  assert_equal "You are not authorized to access this repository, or invalid username/password", source.last_error
65
79
  end
66
80
 
67
- should "handle other error" do
81
+ it "should handle other error" do
68
82
  stub_request(:get, interactions.first.uri).to_return status: 500
69
83
  stub_request(:get, interactions.second.uri).to_return status: 500
70
84
  source.update
71
85
  assert_equal "Last request didn't go as expected, trying again later", source.last_error
72
86
  end
73
87
 
74
- should "handle invlid document entity" do
88
+ it "should handle invlid document entity" do
75
89
  stub_request(:get, interactions.first.uri).to_return body: "Not JSON"
76
90
  stub_request(:get, interactions.last.uri).to_return body: "Not JSON"
77
91
  source.update
78
92
  assert_equal "Last request didn't go as expected, trying again later", source.last_error
79
93
  end
80
94
 
81
- should "capture number of open issues" do
95
+ it "should capture number of open issues" do
82
96
  source.update
83
97
  assert_equal 9, source.metric.values[:open]
84
98
  end
85
99
 
86
- should "capture number of closed issues" do
100
+ it "should capture number of closed issues" do
87
101
  source.update
88
102
  assert_equal 12, source.metric.values[:closed]
89
103
  end
90
104
 
91
105
 
92
- context "activity for open issue" do
93
- setup { source.update }
94
- subject { source.activities.first }
106
+ describe "activity for open issue" do
107
+ before { source.update }
108
+ def activity
109
+ source.activities.first
110
+ end
95
111
 
96
- should "capture issue URL" do
97
- assert_equal "http://github.com/assaf/vanity/issues#issue/21", subject.url
112
+ it "should capture issue URL" do
113
+ assert_equal "http://github.com/assaf/vanity/issues#issue/21", activity.url
98
114
  end
99
115
 
100
- should "use SHA1 for ID" do
101
- assert_match /^[0-9a-f]{40}$/, subject.uid
116
+ it "should use SHA1 for ID" do
117
+ assert_match /^[0-9a-f]{40}$/, activity.uid
102
118
  end
103
119
 
104
- should "capture issue creation time" do
105
- assert_equal Time.parse("2010/08/19 19:59:31 UTC"), subject.timestamp
120
+ it "should capture issue creation time" do
121
+ assert_equal Time.parse("2010/08/19 19:59:31 UTC"), activity.timestamp
106
122
  end
107
123
 
108
- should "capture issue title" do
109
- assert_equal <<-HTML, subject.html
124
+ it "should capture issue title" do
125
+ assert_equal <<-HTML, activity.html
110
126
  opened <a href="http://github.com/assaf/vanity/issues#issue/21">issue 21</a> on assaf/vanity:
111
127
  <blockquote>Vanity 1.4.0 seems to have issues with Bundler</blockquote>
112
128
  HTML
113
129
  end
114
130
 
115
- should "tag as issue and open" do
116
- assert_contains subject.tags, "issue"
117
- assert_contains subject.tags, "opened"
131
+ it "should tag as issue and open" do
132
+ assert activity.tags.include?("issue")
133
+ assert activity.tags.include?("opened")
118
134
  end
119
135
 
120
- should "be valid" do
121
- assert subject.valid?
136
+ it "should be public" do
137
+ assert activity.public?
122
138
  end
123
139
 
124
- context "person" do
125
- subject { source.activities.first.person }
140
+ it "should be valid" do
141
+ assert activity.valid?
142
+ end
126
143
 
127
- should "be GitHub" do
128
- assert_equal "GitHub", subject.fullname
144
+ describe "person" do
145
+ it "should be GitHub" do
146
+ assert_equal "GitHub", person.fullname
129
147
  end
130
148
 
131
- should "have site as identity" do
132
- assert_contains subject.identities, "site:github.com"
149
+ it "should have site as identity" do
150
+ assert person.identities.include?("site:github.com")
133
151
  end
134
152
 
135
- should "use octocat as photo" do
136
- assert_equal "http://github.com/images/error/octocat_happy.gif", subject.photo_url
153
+ it "should use octocat as photo" do
154
+ assert_equal "http://dash-fu.com/images/sources/github.png", person.photo_url
137
155
  end
138
156
  end
139
157
  end
140
158
 
141
- context "activity for closed issue" do
142
- setup { source.update }
143
- subject { source.activities.last }
159
+ describe "activity for closed issue" do
160
+ before { source.update }
144
161
 
145
- should "capture issue URL" do
146
- assert_equal "http://github.com/assaf/vanity/issues#issue/18", subject.url
162
+ it "should capture issue URL" do
163
+ assert_equal "http://github.com/assaf/vanity/issues#issue/18", activity.url
147
164
  end
148
165
 
149
- should "use SHA1 for ID" do
150
- assert_match /^[0-9a-f]{40}$/, subject.uid
166
+ it "should use SHA1 for ID" do
167
+ assert_match /^[0-9a-f]{40}$/, activity.uid
151
168
  end
152
169
 
153
- should "capture issue closing time" do
154
- assert_equal Time.parse("2010/07/03 02:16:42 UTC"), subject.timestamp
170
+ it "should capture issue closing time" do
171
+ assert_equal Time.parse("2010/07/03 02:16:42 UTC"), activity.timestamp
155
172
  end
156
173
 
157
- should "capture issue title" do
158
- assert_equal <<-HTML, subject.html
174
+ it "should capture issue title" do
175
+ assert_equal <<-HTML, activity.html
159
176
  closed <a href="http://github.com/assaf/vanity/issues#issue/18">issue 18</a> on assaf/vanity:
160
177
  <blockquote>Passwords not supported for the Redis config</blockquote>
161
178
  HTML
162
179
  end
163
180
 
164
- should "tag as issue and closed" do
165
- assert_contains subject.tags, "issue"
166
- assert_contains subject.tags, "closed"
181
+ it "should tag as issue and closed" do
182
+ assert activity.tags.include?("issue")
183
+ assert activity.tags.include?("closed")
167
184
  end
168
185
 
169
- should "be valid" do
170
- assert subject.valid?
186
+ it "should be public" do
187
+ assert activity.public?
171
188
  end
172
189
 
173
- context "person" do
174
- subject { source.activities.first.person }
190
+ it "should be valid" do
191
+ assert activity.valid?
192
+ end
175
193
 
176
- should "be GitHub" do
177
- assert_equal "GitHub", subject.fullname
194
+ describe "person" do
195
+ it "should be GitHub" do
196
+ assert_equal "GitHub", person.fullname
178
197
  end
179
198
 
180
- should "have site as identity" do
181
- assert_contains subject.identities, "site:github.com"
199
+ it "should have site as identity" do
200
+ assert person.identities.include?("site:github.com")
182
201
  end
183
202
 
184
- should "use octocat as photo" do
185
- assert_equal "http://github.com/images/error/octocat_happy.gif", subject.photo_url
203
+ it "should use octocat as photo" do
204
+ assert_equal "http://dash-fu.com/images/sources/github.png", person.photo_url
186
205
  end
187
206
  end
188
207
  end
189
208
 
190
209
 
191
- context "repeating" do
192
- setup do
210
+ describe "repeating" do
211
+ before do
193
212
  source.update
194
213
  source.activities.clear
195
214
  open = interactions.select { |i| i.uri =~ /open/ }
@@ -199,28 +218,19 @@ closed <a href="http://github.com/assaf/vanity/issues#issue/18">issue 18</a> on
199
218
  source.update
200
219
  end
201
220
 
202
- should "update open count" do
221
+ it "should update open count" do
203
222
  assert_equal 2, source.metric.values[:open]
204
223
  end
205
224
 
206
- should "update closed count" do
225
+ it "should update closed count" do
207
226
  assert_equal 2, source.metric.values[:closed]
208
227
  end
209
228
 
210
- should "create activity for each issue opened or closed" do
229
+ it "should create activity for each issue opened or closed" do
211
230
  assert_equal 2, source.activities.count
212
231
  end
213
232
  end
214
233
 
215
234
  end
216
235
 
217
-
218
- context "meta" do
219
- setup { source.setup "repo"=>"assaf/vanity" }
220
- subject { source.meta }
221
-
222
- should "link to repository" do
223
- assert_contains subject, title: "On GitHub", url: "http://github.com/assaf/vanity/issues"
224
- end
225
- end
226
236
  end
@@ -1,149 +1,164 @@
1
1
  require_relative "setup"
2
2
 
3
- test DashFu::Bee::Github do
4
- context "setup" do
5
- setup { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
3
+ describe "GitHub" do
4
+ testing :github
6
5
 
7
- should "default branch to master" do
6
+ describe "setup" do
7
+ before { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
8
+
9
+ it "should use repository name" do
10
+ assert_equal "GitHub: assaf/vanity", source.name
11
+ end
12
+
13
+ it "should default branch to master" do
8
14
  source.setup "repo"=>"assaf/vanity", "branch"=>" "
9
- assert_equal "master", source.state["branch"]
15
+ assert_equal "master", source.fields["branch"]
16
+ end
17
+
18
+ it "should set origin from repository name" do
19
+ assert_equal "assaf/vanity", source.origin[:text]
20
+ assert_equal "http://github.com/assaf/vanity", source.origin[:url]
10
21
  end
11
22
 
12
- context "metric" do
13
- subject { source.metric }
23
+ it "should set icon to the octocat" do
24
+ assert_equal "http://dash-fu.com/images/sources/github.png", source.fields[ICON]
25
+ end
14
26
 
15
- should "use repository name" do
16
- assert_equal "GitHub: assaf/vanity", subject.name
17
- end
27
+ it "should accept repository URL" do
28
+ source.setup "repo"=>"http://github.com/assaf/vanity", "branch"=>"master"
29
+ assert_equal "GitHub: assaf/vanity", source.name
30
+ end
18
31
 
19
- should "measure totals" do
20
- assert subject.totals
32
+ describe "metric" do
33
+ it "should measure totals" do
34
+ assert source.metric.totals
21
35
  end
22
36
 
23
- should "capture commits" do
24
- assert subject.columns.include?(:id=>"commits", :label=>"Commits")
37
+ it "should capture commits" do
38
+ assert source.metric.columns.include?(:id=>"commits", :label=>"Commits")
25
39
  end
26
40
 
27
- should "capture watchers" do
28
- assert subject.columns.include?(:id=>"watchers", :label=>"Watchers")
41
+ it "should capture watchers" do
42
+ assert source.metric.columns.include?(:id=>"watchers", :label=>"Watchers")
29
43
  end
30
44
 
31
- should "capture forks" do
32
- assert subject.columns.include?(:id=>"forks", :label=>"Forks")
45
+ it "should capture forks" do
46
+ assert source.metric.columns.include?(:id=>"forks", :label=>"Forks")
33
47
  end
34
48
  end
35
49
  end
36
50
 
37
51
 
38
- context "validation" do
39
- should "raise error if repository name missing" do
40
- assert_raise(RuntimeError) { source.setup "repo"=>" ", "branch"=>"master" }
52
+ describe "validation" do
53
+ it "should raise error if repository name missing" do
54
+ assert_raises(RuntimeError) { source.setup "repo"=>" ", "branch"=>"master" }
41
55
  end
42
56
 
43
- should "raise error if repository name not user/repo" do
44
- assert_raise(RuntimeError) { source.setup "repo"=>"vanity", "branch"=>"master" }
57
+ it "should raise error if repository name not user/repo" do
58
+ assert_raises(RuntimeError) { source.setup "repo"=>"vanity", "branch"=>"master" }
45
59
  end
46
60
 
47
- should "allow alphanumeric, minus and underscore" do
61
+ it "should allow alphanumeric, minus and underscore" do
48
62
  source.setup "repo"=>"assaf/the-vanity_0", "branch"=>"master"
49
63
  assert source.valid?
50
64
  end
51
65
 
52
- should "create valid source" do
66
+ it "should create valid source" do
53
67
  source.setup "repo"=>"assaf/vanity", "branch"=>"master"
54
68
  assert source.valid?
55
69
  end
56
70
  end
57
71
 
58
72
 
59
- context "update" do
60
- setup { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
73
+ describe "update" do
74
+ before { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
61
75
 
62
- should "handle 404" do
76
+ it "should handle 404" do
63
77
  stub_request(:get, interactions.first.uri).to_return :status=>404
64
78
  source.update
65
79
  assert_equal "Could not find the repository assaf/vanity", source.last_error
66
80
  end
67
81
 
68
- should "handle 401" do
82
+ it "should handle 401" do
69
83
  stub_request(:get, interactions.first.uri).to_return :status=>401
70
84
  source.update
71
85
  assert_equal "You are not authorized to access this repository, or invalid username/password", source.last_error
72
86
  end
73
87
 
74
- should "handle other error" do
88
+ it "should handle other error" do
75
89
  stub_request(:get, interactions.first.uri).to_return :status=>500
76
90
  source.update
77
91
  assert_equal "Last request didn't go as expected, trying again later", source.last_error
78
92
  end
79
93
 
80
- should "handle invlid document entity" do
94
+ it "should handle invlid document entity" do
81
95
  stub_request(:get, interactions.first.uri).to_return :body=>"Not JSON"
82
96
  source.update
83
97
  assert_equal "Last request didn't go as expected, trying again later", source.last_error
84
98
  end
85
99
 
86
- should "capture number of commits" do
100
+ it "should capture number of commits" do
87
101
  source.update
88
102
  assert_equal 35, source.metric.values[:commits]
89
103
  end
90
104
 
91
- should "capture number of wacthers" do
105
+ it "should capture number of wacthers" do
92
106
  source.update
93
107
  assert_equal 534, source.metric.values[:watchers]
94
108
  end
95
109
 
96
- should "capture number of forks" do
110
+ it "should capture number of forks" do
97
111
  source.update
98
112
  assert_equal 36, source.metric.values[:forks]
99
113
  end
100
114
 
101
115
 
102
- context "activity" do
103
- setup { source.update }
104
- subject { source.activity }
116
+ describe "activity" do
117
+ before { source.update }
105
118
 
106
- should "capture commit URL" do
107
- assert_equal "http://github.com/assaf/vanity/commit/dd154a9fdd2ac534b62b55b8acac2fd092d6543a", subject.url
119
+ it "should capture commit URL" do
120
+ assert_equal "http://github.com/assaf/vanity/commit/dd154a9fdd2ac534b62b55b8acac2fd092d6543a", activity.url
108
121
  end
109
122
 
110
- should "capture commit SHA" do
111
- assert_equal "dd154a9fdd2ac534b62b55b8acac2fd092d6543a", subject.uid
123
+ it "should capture commit SHA" do
124
+ assert_equal "dd154a9fdd2ac534b62b55b8acac2fd092d6543a", activity.uid
112
125
  end
113
126
 
114
- should "capture timestamp" do
115
- assert_equal Time.parse("2010-08-06T00:18:01-07:00 UTC").utc, subject.timestamp
127
+ it "should capture timestamp" do
128
+ assert_equal Time.parse("2010-08-06T00:18:01-07:00 UTC").utc, activity.timestamp
116
129
  end
117
130
 
118
- should "capture push" do
119
- assert_match %{pushed to master at <a href="http://github.com/assaf/vanity">assaf/vanity</a>:}, subject.html
131
+ it "should capture push" do
132
+ assert_match %{pushed to master at <a href="http://github.com/assaf/vanity">assaf/vanity</a>:}, activity.html
120
133
  end
121
134
 
122
- should "tag as push" do
123
- assert_contains subject.tags, "push"
135
+ it "should tag as push" do
136
+ assert activity.tags.include?("push")
124
137
  end
125
138
 
126
- should "be valid" do
127
- subject.validate
128
- assert subject.valid?
139
+ it "should be public" do
140
+ assert activity.public?
129
141
  end
130
142
 
131
- context "person" do
132
- subject { source.activity.person }
143
+ it "should be valid" do
144
+ activity.validate
145
+ assert activity.valid?
146
+ end
133
147
 
134
- should "capture full name" do
135
- assert_equal "Assaf Arkin", subject.fullname
148
+ describe "person" do
149
+ it "should capture full name" do
150
+ assert_equal "Assaf Arkin", person.fullname
136
151
  end
137
152
 
138
- should "capture email" do
139
- assert_equal "assaf@labnotes.org", subject.email
153
+ it "should capture email" do
154
+ assert_equal "assaf@labnotes.org", person.email
140
155
  end
141
156
 
142
- should "capture identity" do
143
- assert_contains subject.identities, "github.com:assaf"
157
+ it "should capture identity" do
158
+ assert person.identities.include?("github.com:assaf")
144
159
  end
145
160
 
146
- should "not trip on empty login" do
161
+ it "should not trip on empty login" do
147
162
  commits = interactions.select { |i| i.uri =~ /commits\/list/ }
148
163
  stub_request(:get, commits.first.uri).to_return :body=>commits.last.response.body
149
164
  source.update
@@ -153,19 +168,21 @@ test DashFu::Bee::Github do
153
168
  end
154
169
  end
155
170
 
156
- context "commit message" do
157
- subject { (Nokogiri::HTML(source.activity.html)/"blockquote").map(&:inner_text).join("\n") }
171
+ describe "commit message" do
172
+ def subject
173
+ (Nokogiri::HTML(source.activity.html)/"blockquote").map(&:inner_text).join("\n")
174
+ end
158
175
 
159
- should "start with commit SHA" do
176
+ it "should start with commit SHA" do
160
177
  assert_match /^dd154a9 /, subject
161
178
  end
162
179
 
163
- should "include first 50 characters of message" do
180
+ it "should include first 50 characters of message" do
164
181
  with_message "This is a very long message and we're only going to show the first 50 characters of it."
165
182
  assert_equal 50, subject[/\s(.*)/, 1].length
166
183
  end
167
184
 
168
- should "use only first line of message" do
185
+ it "should use only first line of message" do
169
186
  with_message "This message is made\nof two lines"
170
187
  assert_match "This message is made", subject[/\s(.*)/, 1]
171
188
  end
@@ -180,25 +197,25 @@ test DashFu::Bee::Github do
180
197
  end
181
198
  end
182
199
 
183
- context "sequential commits" do
184
- setup do
200
+ describe "sequential commits" do
201
+ before do
185
202
  source.activities.clear
186
203
  interaction = interactions.select { |i| i.uri =~ /commits\/list/ }.last
187
204
  stub_request(:get, interaction.uri).to_return :body=>interaction.response.body
188
205
  source.update
206
+ @message = (Nokogiri::HTML(source.activity.html)/"blockquote")
189
207
  end
190
- subject { (Nokogiri::HTML(source.activity.html)/"blockquote") }
191
208
 
192
- should "show as multiple activities" do
209
+ it "should show as multiple activities" do
193
210
  assert_equal 4, source.activities.count # 4 commits -> 3 activities
194
211
  end
195
212
 
196
- should "merge related commits into single activity" do
197
- assert_equal 2, subject.length # last one has two commits
213
+ it "should merge related commits into single activity" do
214
+ assert_equal 2, @message.length # last one has two commits
198
215
  end
199
216
 
200
- should "merge related commits in order they were listed" do
201
- first, second = subject.map { |bq| bq.inner_text.strip }
217
+ it "should merge related commits in order they were listed" do
218
+ first, second = @message.map { |bq| bq.inner_text.strip }
202
219
  assert_equal "cc156a9 Most recent commit", first
203
220
  assert_equal "dd156a9 Not most recent commit", second
204
221
  end
@@ -207,8 +224,8 @@ test DashFu::Bee::Github do
207
224
  end
208
225
 
209
226
 
210
- context "repeating" do
211
- setup do
227
+ describe "repeating" do
228
+ before do
212
229
  source.update
213
230
  repo = interactions.select { |i| i.uri =~ /repos\/show/ }
214
231
  stub_request(:get, repo.first.uri).to_return :body=>repo.last.response.body
@@ -217,15 +234,15 @@ test DashFu::Bee::Github do
217
234
  source.update
218
235
  end
219
236
 
220
- should "update watchers" do
237
+ it "should update watchers" do
221
238
  assert_equal 555, source.metric.values[:watchers]
222
239
  end
223
240
 
224
- should "update forks" do
241
+ it "should update forks" do
225
242
  assert_equal 38, source.metric.values[:forks]
226
243
  end
227
244
 
228
- should "capture new number of commits" do
245
+ it "should capture new number of commits" do
229
246
  assert_equal 40, source.metric.values[:commits]
230
247
  end
231
248
  end
@@ -233,29 +250,24 @@ test DashFu::Bee::Github do
233
250
  end
234
251
 
235
252
 
236
- context "meta" do
237
- setup { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
238
- subject { source.meta }
239
-
240
- should "link to repository" do
241
- assert_contains subject, :title=>"Repository", :text=>"assaf/vanity", :url=>"http://github.com/assaf/vanity"
242
- end
253
+ describe "meta" do
254
+ before { source.setup "repo"=>"assaf/vanity", "branch"=>"master" }
243
255
 
244
- should "include project description" do
245
- assert_contains subject, :text=>"Experiment Driven Development for Ruby"
256
+ it "should include project description" do
257
+ assert source.meta.include?(:text=>"Experiment Driven Development for Ruby")
246
258
  end
247
259
 
248
- should "link to project home page" do
249
- assert_contains subject, :title=>"Home page", :url=>"http://vanity.labnotes.org"
260
+ it "should link to project home page" do
261
+ assert source.meta.include?(:title=>"Home page", :url=>"http://vanity.labnotes.org")
250
262
  end
251
263
 
252
- should "list branch name" do
253
- assert_contains subject, :title=>"Branch", :text=>"master"
264
+ it "should list branch name" do
265
+ assert source.meta.include?(:title=>"Branch", :text=>"master")
254
266
  end
255
267
 
256
- should "show last commit message" do
257
- assert_contains subject, :title=>"Commit", :text=>"Gemfile changes necessary to pass test suite.",
258
- :url=>"http://github.com/assaf/vanity/commit/dd154a9fdd2ac534b62b55b8acac2fd092d6543a"
268
+ it "should show last commit message" do
269
+ assert source.meta.include?(:title=>"Commit", :text=>"Gemfile changes necessary to pass test suite.",
270
+ :url=>"http://github.com/assaf/vanity/commit/dd154a9fdd2ac534b62b55b8acac2fd092d6543a")
259
271
  end
260
272
  end
261
273
  end