diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-08-30 18:16:57 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-08-30 18:16:57 -0400 |
commit | 251ca535cbc373db51c51ceef1eed603bb9760e3 (patch) | |
tree | e896a1614d859b881e764709b0392105cd8fd88a | |
parent | fda96b4b8ee82eb19ad4e0d061143813b64b4e2b (diff) | |
download | gitlab-ci-251ca535cbc373db51c51ceef1eed603bb9760e3.tar.gz |
`be_(false|true)` -> `be_(falsey|truthy)`
-rw-r--r-- | spec/features/runners_spec.rb | 4 | ||||
-rw-r--r-- | spec/helpers/user_sessions_helper_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/upgrader_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/build_spec.rb | 22 | ||||
-rw-r--r-- | spec/models/commit_spec.rb | 24 | ||||
-rw-r--r-- | spec/models/network_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/hip_chat_message_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/runner_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/create_commit_service_spec.rb | 6 | ||||
-rw-r--r-- | spec/services/create_project_service_spec.rb | 6 | ||||
-rw-r--r-- | spec/services/register_build_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/web_hook_service_spec.rb | 2 |
14 files changed, 54 insertions, 54 deletions
diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb index d023af5..fc78c0e 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -60,7 +60,7 @@ describe "Runners" do click_on "Remove runner" end - Runner.exists?(id: @specific_runner).should be_false + Runner.exists?(id: @specific_runner).should be_falsey end end @@ -75,7 +75,7 @@ describe "Runners" do click_on "Enable shared runners" - @project.reload.shared_runners_enabled.should be_true + @project.reload.shared_runners_enabled.should be_truthy end end diff --git a/spec/helpers/user_sessions_helper_spec.rb b/spec/helpers/user_sessions_helper_spec.rb index a2ab1f1..d438d06 100644 --- a/spec/helpers/user_sessions_helper_spec.rb +++ b/spec/helpers/user_sessions_helper_spec.rb @@ -53,17 +53,17 @@ describe UserSessionsHelper do let (:invalid3) { 'aa:bb:' } it 'should validate oauth state' do - is_oauth_state_valid?(state).should be_true + is_oauth_state_valid?(state).should be_truthy end it 'should not validate forged state' do - is_oauth_state_valid?(forged).should be_false + is_oauth_state_valid?(forged).should be_falsey end it 'should not validate invalid state' do - is_oauth_state_valid?(invalid).should be_false - is_oauth_state_valid?(invalid2).should be_false - is_oauth_state_valid?(invalid3).should be_false + is_oauth_state_valid?(invalid).should be_falsey + is_oauth_state_valid?(invalid2).should be_falsey + is_oauth_state_valid?(invalid3).should be_falsey end end end diff --git a/spec/lib/upgrader_spec.rb b/spec/lib/upgrader_spec.rb index 40a9830..b1c3651 100644 --- a/spec/lib/upgrader_spec.rb +++ b/spec/lib/upgrader_spec.rb @@ -11,7 +11,7 @@ describe Upgrader do describe 'latest_version?' do it 'should be true if newest version' do upgrader.stub(latest_version_raw: current_version) - upgrader.latest_version?.should be_true + upgrader.latest_version?.should be_truthy end end diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index 7333981..ea6b08a 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -69,14 +69,14 @@ describe Build do context 'without started_at' do before { build.started_at = nil } - it { should be_false } + it { should be_falsey } end %w(running success failed).each do |status| context "if build status is #{status}" do before { build.status = status } - it { should be_true } + it { should be_truthy } end end @@ -84,7 +84,7 @@ describe Build do context "if build status is #{status}" do before { build.status = status } - it { should be_false } + it { should be_falsey } end end end @@ -96,7 +96,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_true } + it { should be_truthy } end end @@ -104,7 +104,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_false } + it { should be_falsey } end end end @@ -116,7 +116,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_true } + it { should be_truthy } end end @@ -124,7 +124,7 @@ describe Build do context "if build.status is #{state}" do before { build.status = state } - it { should be_false } + it { should be_falsey } end end end @@ -138,13 +138,13 @@ describe Build do context 'and build.status is success' do before { build.status = 'success' } - it { should be_false } + it { should be_falsey } end context 'and build.status is failed' do before { build.status = 'failed' } - it { should be_false } + it { should be_falsey } end end @@ -154,13 +154,13 @@ describe Build do context 'and build.status is success' do before { build.status = 'success' } - it { should be_false } + it { should be_falsey } end context 'and build.status is failed' do before { build.status = 'failed' } - it { should be_true } + it { should be_truthy } end end end diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 6f644d2..e0dd6fb 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -116,7 +116,7 @@ describe Commit do subject { commit_with_project.compare? } context 'if commit.before_sha are not nil' do - it { should be_true } + it { should be_truthy } end end @@ -140,19 +140,19 @@ describe Commit do end it "creates builds for next type" do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_next_builds(nil).should be_true + commit.create_next_builds(nil).should be_truthy commit.builds.reload commit.builds.size.should == 4 - commit.create_next_builds(nil).should be_true + commit.create_next_builds(nil).should be_truthy commit.builds.reload commit.builds.size.should == 5 - commit.create_next_builds(nil).should be_false + commit.create_next_builds(nil).should be_falsey end end @@ -162,7 +162,7 @@ describe Commit do end it 'creates builds' do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 end @@ -172,27 +172,27 @@ describe Commit do let(:trigger_request) { FactoryGirl.create :trigger_request, commit: commit, trigger: trigger } it 'creates builds' do - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 end it 'rebuilds commit' do - commit.create_builds.should be_true + commit.create_builds.should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 4 end it 'creates next builds' do - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 - commit.create_next_builds(trigger_request).should be_true + commit.create_next_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 4 end @@ -205,7 +205,7 @@ describe Commit do it 'rebuilds commit' do commit.status.should == 'skipped' - commit.create_builds(trigger_request).should be_true + commit.create_builds(trigger_request).should be_truthy commit.builds.reload commit.builds.size.should == 2 commit.status.should == 'pending' diff --git a/spec/models/network_spec.rb b/spec/models/network_spec.rb index b80adba..dc8f89d 100644 --- a/spec/models/network_spec.rb +++ b/spec/models/network_spec.rb @@ -13,7 +13,7 @@ describe Network do network.class.stub(:put) { response } end - it { should be_true } + it { should be_truthy } end context 'on failure' do diff --git a/spec/models/project_services/hip_chat_message_spec.rb b/spec/models/project_services/hip_chat_message_spec.rb index f1ad875..c2aedd9 100644 --- a/spec/models/project_services/hip_chat_message_spec.rb +++ b/spec/models/project_services/hip_chat_message_spec.rb @@ -18,7 +18,7 @@ describe HipChatMessage do build.update(status: "success") expect( subject.status_color ).to eq 'green' - expect( subject.notify? ).to be_false + expect( subject.notify? ).to be_falsey expect( subject.to_s ).to match(/Build '[^']+' #\d+/) expect( subject.to_s ).to match(/Successful in \d+ second\(s\)\./) end @@ -29,7 +29,7 @@ describe HipChatMessage do build.update(status: "failed") expect( subject.status_color ).to eq 'red' - expect( subject.notify? ).to be_true + expect( subject.notify? ).to be_truthy expect( subject.to_s ).to match(/Build '[^']+' #\d+/) expect( subject.to_s ).to match(/Failed in \d+ second\(s\)\./) end @@ -50,7 +50,7 @@ describe HipChatMessage do commit.reload expect( subject.status_color ).to eq 'green' - expect( subject.notify? ).to be_false + expect( subject.notify? ).to be_falsey expect( subject.to_s ).to match(/Commit #\d+/) expect( subject.to_s ).to match(/Successful in \d+ second\(s\)\./) end @@ -65,7 +65,7 @@ describe HipChatMessage do second_build.update(status: "failed") expect( subject.status_color ).to eq 'red' - expect( subject.notify? ).to be_true + expect( subject.notify? ).to be_truthy expect( subject.to_s ).to match(/Commit #\d+/) expect( subject.to_s ).to match(/Failed in \d+ second\(s\)\./) end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index aa76b99..ee8719f 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -161,25 +161,25 @@ describe Project do describe :any_runners do it "there are no runners available" do project = FactoryGirl.create(:project) - project.any_runners?.should be_false + project.any_runners?.should be_falsey end it "there is a specific runner" do project = FactoryGirl.create(:project) project.runners << FactoryGirl.create(:specific_runner) - project.any_runners?.should be_true + project.any_runners?.should be_truthy end it "there is a shared runner" do project = FactoryGirl.create(:project, shared_runners_enabled: true) FactoryGirl.create(:shared_runner) - project.any_runners?.should be_true + project.any_runners?.should be_truthy end it "there is a shared runner, but they are prohibited to use" do project = FactoryGirl.create(:project) FactoryGirl.create(:shared_runner) - project.any_runners?.should be_false + project.any_runners?.should be_falsey end end end diff --git a/spec/models/runner_spec.rb b/spec/models/runner_spec.rb index 6902c0a..4ccad87 100644 --- a/spec/models/runner_spec.rb +++ b/spec/models/runner_spec.rb @@ -45,7 +45,7 @@ describe Runner do it { shared_runner.should be_specific } it { shared_runner.projects.should == [project] } - it { shared_runner.only_for?(project).should be_true } + it { shared_runner.only_for?(project).should be_truthy } end describe "belongs_to_one_project?" do @@ -56,7 +56,7 @@ describe Runner do project.runners << runner project1.runners << runner - runner.belongs_to_one_project?.should be_false + runner.belongs_to_one_project?.should be_falsey end it "returns true" do @@ -64,7 +64,7 @@ describe Runner do project = FactoryGirl.create(:project) project.runners << runner - runner.belongs_to_one_project?.should be_true + runner.belongs_to_one_project?.should be_truthy end end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5c1a26f..6d3ad9f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -42,13 +42,13 @@ describe User do it "returns false for reporter" do @user.stub(:project_info).and_return(project_with_reporter_access) - @user.has_developer_access?(1).should be_false + @user.has_developer_access?(1).should be_falsey end it "returns true for owner" do @user.stub(:project_info).and_return(project_with_owner_access) - @user.has_developer_access?(1).should be_true + @user.has_developer_access?(1).should be_truthy end end diff --git a/spec/services/create_commit_service_spec.rb b/spec/services/create_commit_service_spec.rb index 34e00d5..631d4b0 100644 --- a/spec/services/create_commit_service_spec.rb +++ b/spec/services/create_commit_service_spec.rb @@ -59,7 +59,7 @@ describe CreateCommitService do commits: commits, ci_yaml_file: gitlab_ci_yaml ) - commit.builds.any?.should be_false + commit.builds.any?.should be_falsey commit.status.should == "skipped" end @@ -86,7 +86,7 @@ describe CreateCommitService do commits: commits, ci_yaml_file: "invalid: file" ) - commit.builds.any?.should be_false + commit.builds.any?.should be_falsey commit.status.should == "skipped" end end @@ -124,7 +124,7 @@ describe CreateCommitService do ) commit.status.should == "failed" - commit.builds.any?.should be_false + commit.builds.any?.should be_falsey end end end diff --git a/spec/services/create_project_service_spec.rb b/spec/services/create_project_service_spec.rb index d112583..4d21237 100644 --- a/spec/services/create_project_service_spec.rb +++ b/spec/services/create_project_service_spec.rb @@ -31,9 +31,9 @@ describe CreateProjectService do project = service.execute(current_user, project_dump, 'http://localhost/projects/:project_id', origin_project) - project.shared_runners_enabled.should be_true - project.public.should be_true - project.allow_git_fetch.should be_true + project.shared_runners_enabled.should be_truthy + project.public.should be_truthy + project.allow_git_fetch.should be_truthy end end end diff --git a/spec/services/register_build_service_spec.rb b/spec/services/register_build_service_spec.rb index b5af777..68dfb9c 100644 --- a/spec/services/register_build_service_spec.rb +++ b/spec/services/register_build_service_spec.rb @@ -25,7 +25,7 @@ describe RegisterBuildService do pending_build.tag_list = ["linux"] pending_build.save specific_runner.tag_list = ["win32"] - service.execute(specific_runner).should be_false + service.execute(specific_runner).should be_falsey end it "picks build without tag" do @@ -35,7 +35,7 @@ describe RegisterBuildService do it "does not pick build with tag" do pending_build.tag_list = ["linux"] pending_build.save - service.execute(specific_runner).should be_false + service.execute(specific_runner).should be_falsey end it "pick build without tag" do diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb index 2bb1539..a0c1d04 100644 --- a/spec/services/web_hook_service_spec.rb +++ b/spec/services/web_hook_service_spec.rb @@ -9,7 +9,7 @@ describe WebHookService do describe :execute do it "should execute successfully" do stub_request(:post, hook.url).to_return(status: 200) - WebHookService.new.build_end(build).should be_true + WebHookService.new.build_end(build).should be_truthy end end |