diff options
Diffstat (limited to 'spec/validators/branch_filter_validator_spec.rb')
-rw-r--r-- | spec/validators/branch_filter_validator_spec.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/spec/validators/branch_filter_validator_spec.rb b/spec/validators/branch_filter_validator_spec.rb index 3be54827431..957d1dd99bb 100644 --- a/spec/validators/branch_filter_validator_spec.rb +++ b/spec/validators/branch_filter_validator_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe BranchFilterValidator do @@ -6,25 +8,25 @@ describe BranchFilterValidator do describe '#validates_each' do it 'allows valid branch names' do - validator.validate_each(hook, :push_events_branch_filter, "good_branch_name") - validator.validate_each(hook, :push_events_branch_filter, "another/good_branch_name") + validator.validate_each(hook, :push_events_branch_filter, +"good_branch_name") + validator.validate_each(hook, :push_events_branch_filter, +"another/good_branch_name") expect(hook.errors.empty?).to be true end it 'disallows bad branch names' do - validator.validate_each(hook, :push_events_branch_filter, "bad branch~name") + validator.validate_each(hook, :push_events_branch_filter, +"bad branch~name") expect(hook.errors[:push_events_branch_filter].empty?).to be false end it 'allows wildcards' do - validator.validate_each(hook, :push_events_branch_filter, "features/*") - validator.validate_each(hook, :push_events_branch_filter, "features/*/bla") - validator.validate_each(hook, :push_events_branch_filter, "*-stable") + validator.validate_each(hook, :push_events_branch_filter, +"features/*") + validator.validate_each(hook, :push_events_branch_filter, +"features/*/bla") + validator.validate_each(hook, :push_events_branch_filter, +"*-stable") expect(hook.errors.empty?).to be true end it 'gets rid of whitespace' do - filter = ' master ' + filter = +' master ' validator.validate_each(hook, :push_events_branch_filter, filter) expect(filter).to eq 'master' |