|
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 | end |
37 | 37 |
|
38 | 38 | describe :raw do |
39 | 39 | let(:raw_blob) { Gitlab::Git::Blob.raw(repository, SeedRepo::RubyBlob::ID) } |
40 | | - it { raw_blob.id.should == SeedRepo::RubyBlob::ID } |
41 | | - it { raw_blob.data[0..10].should == "require \'fi" } |
42 | | - it { raw_blob.size.should == 669 } |
| 40 | + it { raw_blob.id == SeedRepo::RubyBlob::ID } |
| 41 | + it { raw_blob.data[0..10] == "require \'fi" } |
| 42 | + it { raw_blob.size == 669 } |
43 | 43 | end |
44 | 44 |
|
45 | 45 | describe 'encoding' do |
46 | 46 | context 'file with russian text' do |
47 | 47 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/russian.rb") } |
48 | 48 |
|
49 | | - it { blob.name.should == "russian.rb" } |
50 | | - it { blob.data.lines.first.should == "Хороший файл" } |
51 | | - it { blob.size.should == 23 } |
| 49 | + it { blob.name == "russian.rb" } |
| 50 | + it { blob.data.lines.first == "Хороший файл" } |
| 51 | + it { blob.size == 23 } |
52 | 52 | end |
53 | 53 |
|
54 | 54 | context 'file with Chinese text' do |
55 | 55 | let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/テスト.txt") } |
56 | 56 |
|
57 | | - it { blob.name.should == "テスト.txt" } |
58 | | - it { blob.data.should include("これはテスト") } |
59 | | - it { blob.size.should == 340 } |
| 57 | + it { blob.name == "テスト.txt" } |
| 58 | + it { expect(blob.data).to include("これはテスト") } |
| 59 | + it { blob.size == 340 } |
60 | 60 | end |
61 | 61 | end |
62 | 62 | end |
0 commit comments