Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit 46f7ba2

Browse files
committed
update rspec to 3.1
1 parent d6c3928 commit 46f7ba2

13 files changed

+204
-198
lines changed

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ gemspec
44

55
group :development do
66
gem 'coveralls', require: false
7-
gem 'rspec'
7+
gem 'rspec', '~> 3.1.0'
88
gem 'webmock'
99
gem 'guard'
10-
gem 'guard-rspec'
10+
gem 'guard-rspec', require: false
1111
gem 'pry'
1212
gem 'rake'
1313
end

Gemfile.lock

+40-33
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ GEM
1717
thread_safe (~> 0.1)
1818
tzinfo (~> 1.1)
1919
addressable (2.3.4)
20+
celluloid (0.16.0)
21+
timers (~> 4.0.0)
2022
charlock_holmes (0.6.9.4)
21-
coderay (1.0.9)
23+
coderay (1.1.0)
2224
colorize (0.5.8)
2325
coveralls (0.6.7)
2426
colorize
@@ -30,61 +32,66 @@ GEM
3032
diff-lcs (1.2.5)
3133
docile (1.1.5)
3234
escape_utils (0.2.4)
33-
ffi (1.8.1)
34-
formatador (0.2.4)
35+
ffi (1.9.6)
36+
formatador (0.2.5)
3537
gitlab-linguist (3.0.0)
3638
charlock_holmes (~> 0.6.6)
3739
escape_utils (~> 0.2.4)
3840
mime-types (~> 1.19)
39-
guard (1.8.0)
41+
guard (2.10.0)
4042
formatador (>= 0.2.4)
41-
listen (>= 1.0.0)
42-
lumberjack (>= 1.0.2)
43-
pry (>= 0.9.10)
44-
thor (>= 0.14.6)
45-
guard-rspec (2.5.4)
46-
guard (>= 1.1)
47-
rspec (~> 2.11)
43+
listen (~> 2.7)
44+
lumberjack (~> 1.0)
45+
pry (>= 0.9.12)
46+
thor (>= 0.18.1)
47+
guard-rspec (4.3.1)
48+
guard (~> 2.1)
49+
rspec (>= 2.14, < 4.0)
50+
hitimes (1.2.2)
4851
i18n (0.6.11)
4952
json (1.8.1)
50-
listen (1.0.2)
53+
listen (2.8.3)
54+
celluloid (>= 0.15.2)
5155
rb-fsevent (>= 0.9.3)
5256
rb-inotify (>= 0.9)
53-
rb-kqueue (>= 0.2)
54-
lumberjack (1.0.3)
55-
method_source (0.8.1)
57+
lumberjack (1.0.9)
58+
method_source (0.8.2)
5659
mime-types (1.25.1)
5760
minitest (5.4.2)
5861
multi_json (1.10.1)
59-
pry (0.9.12.1)
60-
coderay (~> 1.0.5)
61-
method_source (~> 0.8)
62+
pry (0.10.1)
63+
coderay (~> 1.1.0)
64+
method_source (~> 0.8.1)
6265
slop (~> 3.4)
6366
rake (10.3.2)
64-
rb-fsevent (0.9.3)
65-
rb-inotify (0.9.0)
66-
ffi (>= 0.5.0)
67-
rb-kqueue (0.2.0)
67+
rb-fsevent (0.9.4)
68+
rb-inotify (0.9.5)
6869
ffi (>= 0.5.0)
6970
rest-client (1.6.7)
7071
mime-types (>= 1.16)
71-
rspec (2.13.0)
72-
rspec-core (~> 2.13.0)
73-
rspec-expectations (~> 2.13.0)
74-
rspec-mocks (~> 2.13.0)
75-
rspec-core (2.13.1)
76-
rspec-expectations (2.13.0)
77-
diff-lcs (>= 1.1.3, < 2.0)
78-
rspec-mocks (2.13.1)
72+
rspec (3.1.0)
73+
rspec-core (~> 3.1.0)
74+
rspec-expectations (~> 3.1.0)
75+
rspec-mocks (~> 3.1.0)
76+
rspec-core (3.1.7)
77+
rspec-support (~> 3.1.0)
78+
rspec-expectations (3.1.2)
79+
diff-lcs (>= 1.2.0, < 2.0)
80+
rspec-support (~> 3.1.0)
81+
rspec-mocks (3.1.3)
82+
rspec-support (~> 3.1.0)
83+
rspec-support (3.1.2)
7984
rugged (0.21.2)
8085
simplecov (0.9.0)
8186
docile (~> 1.1.0)
8287
multi_json
8388
simplecov-html (~> 0.8.0)
8489
simplecov-html (0.8.0)
85-
slop (3.4.4)
86-
thor (0.18.1)
90+
slop (3.6.0)
91+
thor (0.19.1)
8792
thread_safe (0.3.4)
93+
timers (4.0.1)
94+
hitimes
8895
tzinfo (1.2.2)
8996
thread_safe (~> 0.1)
9097
webmock (1.11.0)
@@ -101,6 +108,6 @@ DEPENDENCIES
101108
guard-rspec
102109
pry
103110
rake
104-
rspec
111+
rspec (~> 3.1.0)
105112
simplecov
106113
webmock

spec/blame_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
context "each count" do
1010
it do
1111
blame.each do |commit, hunk_lines|
12-
commit.should be_kind_of Gitlab::Git::Commit
13-
hunk_lines.first.should == "# Contribute to GitLab"
12+
expect(commit).to be_kind_of Gitlab::Git::Commit
13+
hunk_lines.first == "# Contribute to GitLab"
1414
end
1515
end
1616
end

spec/blob_snippet_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
context 'empty lines' do
88
let(:snippet) { Gitlab::Git::BlobSnippet.new('master', nil, nil, nil) }
99

10-
it { snippet.data.should be_nil }
10+
it { snippet.data == nil }
1111
end
1212

1313
context 'present lines' do
1414
let(:snippet) { Gitlab::Git::BlobSnippet.new('master', ['wow', 'much'], 1, 'wow.rb') }
1515

16-
it { snippet.data.should == "wow\nmuch" }
16+
it { snippet.data == "wow\nmuch" }
1717
end
1818
end
1919
end

spec/blob_spec.rb

+24-24
Original file line numberDiff line numberDiff line change
@@ -9,61 +9,61 @@
99
context 'file in subdir' do
1010
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "files/ruby/popen.rb") }
1111

12-
it { blob.id.should == SeedRepo::RubyBlob::ID }
13-
it { blob.name.should == SeedRepo::RubyBlob::NAME }
14-
it { blob.path.should == "files/ruby/popen.rb" }
15-
it { blob.commit_id.should == SeedRepo::Commit::ID }
16-
it { blob.data[0..10].should == SeedRepo::RubyBlob::CONTENT[0..10] }
17-
it { blob.size.should == 669 }
12+
it { blob.id == SeedRepo::RubyBlob::ID }
13+
it { blob.name == SeedRepo::RubyBlob::NAME }
14+
it { blob.path == "files/ruby/popen.rb" }
15+
it { blob.commit_id == SeedRepo::Commit::ID }
16+
it { blob.data[0..10] == SeedRepo::RubyBlob::CONTENT[0..10] }
17+
it { blob.size == 669 }
1818
end
1919

2020
context 'file in root' do
2121
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, ".gitignore") }
2222

23-
it { blob.id.should == "dfaa3f97ca337e20154a98ac9d0be76ddd1fcc82" }
24-
it { blob.name.should == ".gitignore" }
25-
it { blob.path.should == ".gitignore" }
26-
it { blob.commit_id.should == SeedRepo::Commit::ID }
27-
it { blob.data[0..10].should == "*.rbc\n*.sas" }
28-
it { blob.size.should == 241 }
23+
it { blob.id == "dfaa3f97ca337e20154a98ac9d0be76ddd1fcc82" }
24+
it { blob.name == ".gitignore" }
25+
it { blob.path == ".gitignore" }
26+
it { blob.commit_id == SeedRepo::Commit::ID }
27+
it { blob.data[0..10] == "*.rbc\n*.sas" }
28+
it { blob.size == 241 }
2929
end
3030

3131
context 'non-exist file' do
3232
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "missing.rb") }
3333

34-
it { blob.should be_nil }
34+
it { blob == nil }
3535
end
3636

3737
context 'six submodule' do
3838
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, 'six') }
3939

40-
it { blob.id.should == '409f37c4f05865e4fb208c771485f211a22c4c2d' }
41-
it { blob.data.should == '' }
40+
it { blob.id == '409f37c4f05865e4fb208c771485f211a22c4c2d' }
41+
it { blob.data == '' }
4242
end
4343
end
4444

4545
describe :raw do
4646
let(:raw_blob) { Gitlab::Git::Blob.raw(repository, SeedRepo::RubyBlob::ID) }
47-
it { raw_blob.id.should == SeedRepo::RubyBlob::ID }
48-
it { raw_blob.data[0..10].should == "require \'fi" }
49-
it { raw_blob.size.should == 669 }
47+
it { raw_blob.id == SeedRepo::RubyBlob::ID }
48+
it { raw_blob.data[0..10] == "require \'fi" }
49+
it { raw_blob.size == 669 }
5050
end
5151

5252
describe 'encoding' do
5353
context 'file with russian text' do
5454
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/russian.rb") }
5555

56-
it { blob.name.should == "russian.rb" }
57-
it { blob.data.lines.first.should == "Хороший файл" }
58-
it { blob.size.should == 23 }
56+
it { blob.name == "russian.rb" }
57+
it { blob.data.lines.first == "Хороший файл" }
58+
it { blob.size == 23 }
5959
end
6060

6161
context 'file with Chinese text' do
6262
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/テスト.txt") }
6363

64-
it { blob.name.should == "テスト.txt" }
65-
it { blob.data.should include("これはテスト") }
66-
it { blob.size.should == 340 }
64+
it { blob.name == "テスト.txt" }
65+
it { expect(blob.data).to include("これはテスト") }
66+
it { blob.size == 340 }
6767
end
6868
end
6969
end

spec/branch_spec.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
subject { repository.branches }
77

88
it { should be_kind_of Array }
9-
its(:size) { should eq(3) }
9+
it { subject.size == 3 }
1010

1111
describe 'first branch' do
1212
let(:branch) { repository.branches.first }
1313

14-
it { branch.name.should == SeedRepo::Repo::BRANCHES.first }
15-
it { branch.target.should == "0b4bc9a49b562e85de7cc9e834518ea6828729b9" }
14+
it { branch.name == SeedRepo::Repo::BRANCHES.first }
15+
it { branch.target == "0b4bc9a49b562e85de7cc9e834518ea6828729b9" }
1616
end
1717

1818
describe 'last branch' do
1919
let(:branch) { repository.branches.last }
2020

21-
it { branch.name.should == SeedRepo::Repo::BRANCHES.last }
22-
it { branch.target.should == SeedRepo::LastCommit::ID }
21+
it { branch.name == SeedRepo::Repo::BRANCHES.last }
22+
it { branch.target == SeedRepo::LastCommit::ID }
2323
end
2424

25-
it { repository.branches.size.should == SeedRepo::Repo::BRANCHES.size }
25+
it { repository.branches.size == SeedRepo::Repo::BRANCHES.size }
2626
end

0 commit comments

Comments
 (0)