git-trend 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,13 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  include GitTrend
5
+
6
+ RSpec.shared_examples_for 'since daily ranking' do
7
+ it 'display daily ranking' do
8
+ expect { @cli.invoke(:list, [], since: since) }.to output(dummy_result_no_options).to_stdout
9
+ end
10
+ end
11
+
5
12
  RSpec.describe GitTrend::CLI do
6
13
 
7
14
  describe '#list' do
@@ -102,12 +109,20 @@ RSpec.describe GitTrend::CLI do
102
109
  end
103
110
 
104
111
  describe 'with -s option' do
112
+ before { stub_request_get("trending?since=#{since}") }
113
+
114
+ context 'with no option' do
115
+ let(:since) { '' }
116
+ it_behaves_like 'since daily ranking'
117
+ end
118
+
119
+ context 'with daily' do
120
+ let(:since) { 'daily' }
121
+ it_behaves_like 'since daily ranking'
122
+ end
123
+
105
124
  context 'with weekly' do
106
- before do
107
- stub_request_get("trending?since=#{since}")
108
- end
109
125
  let(:since) { 'weekly' }
110
-
111
126
  it 'display daily ranking since weekly' do
112
127
  res = <<-'EOS'.unindent
113
128
  |No. Name Lang Star Fork
@@ -143,11 +158,7 @@ RSpec.describe GitTrend::CLI do
143
158
  end
144
159
 
145
160
  context 'with monthly' do
146
- before do
147
- stub_request_get("trending?since=#{since}")
148
- end
149
161
  let(:since) { 'monthly' }
150
-
151
162
  it 'display daily ranking since monthly' do
152
163
  res = <<-'EOS'.unindent
153
164
  |No. Name Lang Star Fork
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-trend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rochefort
@@ -180,6 +180,8 @@ files:
180
180
  - spec/fixtures/trending?l=objective-c%2B%2B
181
181
  - spec/fixtures/trending?l=ruby
182
182
  - spec/fixtures/trending?l=ruby&since=weekly
183
+ - spec/fixtures/trending?since=
184
+ - spec/fixtures/trending?since=daily
183
185
  - spec/fixtures/trending?since=monthly
184
186
  - spec/fixtures/trending?since=weekly
185
187
  - spec/git_trend/cli_spec.rb
@@ -214,6 +216,8 @@ test_files:
214
216
  - spec/fixtures/trending?l=objective-c%2B%2B
215
217
  - spec/fixtures/trending?l=ruby
216
218
  - spec/fixtures/trending?l=ruby&since=weekly
219
+ - spec/fixtures/trending?since=
220
+ - spec/fixtures/trending?since=daily
217
221
  - spec/fixtures/trending?since=monthly
218
222
  - spec/fixtures/trending?since=weekly
219
223
  - spec/git_trend/cli_spec.rb