|
9 | 9 | context 'file in subdir' do |
10 | 10 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "files/ruby/popen.rb") } |
11 | 11 |
|
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 } |
18 | 18 | end |
19 | 19 |
|
20 | 20 | context 'file in root' do |
21 | 21 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, ".gitignore") } |
22 | 22 |
|
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 } |
29 | 29 | end |
30 | 30 |
|
31 | 31 | context 'non-exist file' do |
32 | 32 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "missing.rb") } |
33 | 33 |
|
34 | | - it { blob.should be_nil } |
| 34 | + it { blob == nil } |
35 | 35 | end |
36 | 36 |
|
37 | 37 | context 'six submodule' do |
38 | 38 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, 'six') } |
39 | 39 |
|
40 | | - it { blob.id.should == '409f37c4f05865e4fb208c771485f211a22c4c2d' } |
41 | | - it { blob.data.should == '' } |
| 40 | + it { blob.id == '409f37c4f05865e4fb208c771485f211a22c4c2d' } |
| 41 | + it { blob.data == '' } |
42 | 42 | end |
43 | 43 | end |
44 | 44 |
|
45 | 45 | describe :raw do |
46 | 46 | 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 } |
50 | 50 | end |
51 | 51 |
|
52 | 52 | describe 'encoding' do |
53 | 53 | context 'file with russian text' do |
54 | 54 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/russian.rb") } |
55 | 55 |
|
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 } |
59 | 59 | end |
60 | 60 |
|
61 | 61 | context 'file with Chinese text' do |
62 | 62 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/テスト.txt") } |
63 | 63 |
|
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 } |
67 | 67 | end |
68 | 68 | end |
69 | 69 | end |
0 commit comments