-
Notifications
You must be signed in to change notification settings - Fork 51
update rspec to 3.1 #54
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,61 +9,61 @@ | |
context 'file in subdir' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "files/ruby/popen.rb") } | ||
|
||
it { blob.id.should == SeedRepo::RubyBlob::ID } | ||
it { blob.name.should == SeedRepo::RubyBlob::NAME } | ||
it { blob.path.should == "files/ruby/popen.rb" } | ||
it { blob.commit_id.should == SeedRepo::Commit::ID } | ||
it { blob.data[0..10].should == SeedRepo::RubyBlob::CONTENT[0..10] } | ||
it { blob.size.should == 669 } | ||
it { blob.id == SeedRepo::RubyBlob::ID } | ||
it { blob.name == SeedRepo::RubyBlob::NAME } | ||
it { blob.path == "files/ruby/popen.rb" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.commit_id == SeedRepo::Commit::ID } | ||
it { blob.data[0..10] == SeedRepo::RubyBlob::CONTENT[0..10] } | ||
it { blob.size == 669 } | ||
end | ||
|
||
context 'file in root' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, ".gitignore") } | ||
|
||
it { blob.id.should == "dfaa3f97ca337e20154a98ac9d0be76ddd1fcc82" } | ||
it { blob.name.should == ".gitignore" } | ||
it { blob.path.should == ".gitignore" } | ||
it { blob.commit_id.should == SeedRepo::Commit::ID } | ||
it { blob.data[0..10].should == "*.rbc\n*.sas" } | ||
it { blob.size.should == 241 } | ||
it { blob.id == "dfaa3f97ca337e20154a98ac9d0be76ddd1fcc82" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.name == ".gitignore" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.path == ".gitignore" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.commit_id == SeedRepo::Commit::ID } | ||
it { blob.data[0..10] == "*.rbc\n*.sas" } | ||
it { blob.size == 241 } | ||
end | ||
|
||
context 'non-exist file' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "missing.rb") } | ||
|
||
it { blob.should be_nil } | ||
it { blob == nil } | ||
end | ||
|
||
context 'six submodule' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, 'six') } | ||
|
||
it { blob.id.should == '409f37c4f05865e4fb208c771485f211a22c4c2d' } | ||
it { blob.data.should == '' } | ||
it { blob.id == '409f37c4f05865e4fb208c771485f211a22c4c2d' } | ||
it { blob.data == '' } | ||
end | ||
end | ||
|
||
describe :raw do | ||
let(:raw_blob) { Gitlab::Git::Blob.raw(repository, SeedRepo::RubyBlob::ID) } | ||
it { raw_blob.id.should == SeedRepo::RubyBlob::ID } | ||
it { raw_blob.data[0..10].should == "require \'fi" } | ||
it { raw_blob.size.should == 669 } | ||
it { raw_blob.id == SeedRepo::RubyBlob::ID } | ||
it { raw_blob.data[0..10] == "require \'fi" } | ||
it { raw_blob.size == 669 } | ||
end | ||
|
||
describe 'encoding' do | ||
context 'file with russian text' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/russian.rb") } | ||
|
||
it { blob.name.should == "russian.rb" } | ||
it { blob.data.lines.first.should == "Хороший файл" } | ||
it { blob.size.should == 23 } | ||
it { blob.name == "russian.rb" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.data.lines.first == "Хороший файл" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.size == 23 } | ||
end | ||
|
||
context 'file with Chinese text' do | ||
let(:blob) { Gitlab::Git::Blob.find(repository, SeedRepo::Commit::ID, "encoding/テスト.txt") } | ||
|
||
it { blob.name.should == "テスト.txt" } | ||
it { blob.data.should include("これはテスト") } | ||
it { blob.size.should == 340 } | ||
it { blob.name == "テスト.txt" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { expect(blob.data).to include("これはテスト") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
it { blob.size == 340 } | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,21 +6,21 @@ | |
subject { repository.branches } | ||
|
||
it { should be_kind_of Array } | ||
its(:size) { should eq(3) } | ||
it { subject.size == 3 } | ||
|
||
describe 'first branch' do | ||
let(:branch) { repository.branches.first } | ||
|
||
it { branch.name.should == SeedRepo::Repo::BRANCHES.first } | ||
it { branch.target.should == "0b4bc9a49b562e85de7cc9e834518ea6828729b9" } | ||
it { branch.name == SeedRepo::Repo::BRANCHES.first } | ||
it { branch.target == "0b4bc9a49b562e85de7cc9e834518ea6828729b9" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
end | ||
|
||
describe 'last branch' do | ||
let(:branch) { repository.branches.last } | ||
|
||
it { branch.name.should == SeedRepo::Repo::BRANCHES.last } | ||
it { branch.target.should == SeedRepo::LastCommit::ID } | ||
it { branch.name == SeedRepo::Repo::BRANCHES.last } | ||
it { branch.target == SeedRepo::LastCommit::ID } | ||
end | ||
|
||
it { repository.branches.size.should == SeedRepo::Repo::BRANCHES.size } | ||
it { repository.branches.size == SeedRepo::Repo::BRANCHES.size } | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer single-quoted strings when you don't need string interpolation or special symbols.