From 422236c71eb8f1c88e83331b6eb74211fd7ccf49 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 13 Jun 2015 18:24:51 -0400 Subject: Change `foo.should` syntax to `expect(foo).to` in specs --- spec/services/destroy_group_service_spec.rb | 8 ++++---- spec/services/projects/destroy_service_spec.rb | 8 ++++---- spec/services/projects/transfer_service_spec.rb | 6 ++---- 3 files changed, 10 insertions(+), 12 deletions(-) (limited to 'spec/services') diff --git a/spec/services/destroy_group_service_spec.rb b/spec/services/destroy_group_service_spec.rb index 2a7372b986e..e28564b3866 100644 --- a/spec/services/destroy_group_service_spec.rb +++ b/spec/services/destroy_group_service_spec.rb @@ -23,8 +23,8 @@ describe DestroyGroupService do Sidekiq::Testing.inline! { destroy_group(group, user) } end - it { gitlab_shell.exists?(group.path).should be_falsey } - it { gitlab_shell.exists?(remove_path).should be_falsey } + it { expect(gitlab_shell.exists?(group.path)).to be_falsey } + it { expect(gitlab_shell.exists?(remove_path)).to be_falsey } end context 'Sidekiq fake' do @@ -33,8 +33,8 @@ describe DestroyGroupService do Sidekiq::Testing.fake! { destroy_group(group, user) } end - it { gitlab_shell.exists?(group.path).should be_falsey } - it { gitlab_shell.exists?(remove_path).should be_truthy } + it { expect(gitlab_shell.exists?(group.path)).to be_falsey } + it { expect(gitlab_shell.exists?(remove_path)).to be_truthy } end end diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb index 381008def5f..e83eef0b1a2 100644 --- a/spec/services/projects/destroy_service_spec.rb +++ b/spec/services/projects/destroy_service_spec.rb @@ -13,8 +13,8 @@ describe Projects::DestroyService do end it { expect(Project.all).not_to include(project) } - it { Dir.exists?(path).should be_falsey } - it { Dir.exists?(remove_path).should be_falsey } + it { expect(Dir.exists?(path)).to be_falsey } + it { expect(Dir.exists?(remove_path)).to be_falsey } end context 'Sidekiq fake' do @@ -24,8 +24,8 @@ describe Projects::DestroyService do end it { expect(Project.all).not_to include(project) } - it { Dir.exists?(path).should be_falsey } - it { Dir.exists?(remove_path).should be_truthy } + it { expect(Dir.exists?(path)).to be_falsey } + it { expect(Dir.exists?(remove_path)).to be_truthy } end def destroy_project(project, user, params) diff --git a/spec/services/projects/transfer_service_spec.rb b/spec/services/projects/transfer_service_spec.rb index 5650626fb18..79acba78bda 100644 --- a/spec/services/projects/transfer_service_spec.rb +++ b/spec/services/projects/transfer_service_spec.rb @@ -20,8 +20,7 @@ describe Projects::TransferService do @result = transfer_project(project, user, new_namespace_id: nil) end - it { expect(@result).not_to be_nil } # { result.should be_false } passes on nil - it { expect(@result).to be_falsey } + it { expect(@result).to eq false } it { expect(project.namespace).to eq(user.namespace) } end @@ -30,8 +29,7 @@ describe Projects::TransferService do @result = transfer_project(project, user, new_namespace_id: group.id) end - it { expect(@result).not_to be_nil } # { result.should be_false } passes on nil - it { expect(@result).to be_falsey } + it { expect(@result).to eq false } it { expect(project.namespace).to eq(user.namespace) } end -- cgit v1.2.3