diff options
author | Pascal Betz <pascal.betz@gmail.com> | 2016-09-08 15:30:16 +0200 |
---|---|---|
committer | Pascal Betz <pascal.betz@gmail.com> | 2016-09-08 15:46:22 +0200 |
commit | d027ed719dfdfabb687985ec6d4c6301953102cc (patch) | |
tree | e02d4b7e221fd7c37d886c95fea236138b3be66b /spec/helpers | |
parent | de6a44fae6273c44ef27ff55d13799efc9756acd (diff) | |
download | gitlab-ce-d027ed719dfdfabb687985ec6d4c6301953102cc.tar.gz |
Reformat Regexp
Fix show template (missing tr)
Separate exercise/verify
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/sidekiq_helper_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/helpers/sidekiq_helper_spec.rb b/spec/helpers/sidekiq_helper_spec.rb index 2eb1c816bc5..d60839b78ec 100644 --- a/spec/helpers/sidekiq_helper_spec.rb +++ b/spec/helpers/sidekiq_helper_spec.rb @@ -5,30 +5,35 @@ describe SidekiqHelper do it 'parses line with time' do line = '55137 10,0 2,1 S+ 2:30pm sidekiq 4.1.4 gitlab [0 of 25 busy] ' parts = helper.parse_sidekiq_ps(line) + expect(parts).to eq(['55137', '10,0', '2,1', 'S+', '2:30pm', 'sidekiq 4.1.4 gitlab [0 of 25 busy]']) end it 'parses line with date' do line = '55137 10,0 2,1 S+ Aug 4 sidekiq 4.1.4 gitlab [0 of 25 busy] ' parts = helper.parse_sidekiq_ps(line) + expect(parts).to eq(['55137', '10,0', '2,1', 'S+', 'Aug 4', 'sidekiq 4.1.4 gitlab [0 of 25 busy]']) end it 'parses line with two digit date' do line = '55137 10,0 2,1 S+ Aug 04 sidekiq 4.1.4 gitlab [0 of 25 busy] ' parts = helper.parse_sidekiq_ps(line) + expect(parts).to eq(['55137', '10,0', '2,1', 'S+', 'Aug 04', 'sidekiq 4.1.4 gitlab [0 of 25 busy]']) end it 'parses line with dot as float separator' do line = '55137 10.0 2.1 S+ 2:30pm sidekiq 4.1.4 gitlab [0 of 25 busy] ' parts = helper.parse_sidekiq_ps(line) + expect(parts).to eq(['55137', '10.0', '2.1', 'S+', '2:30pm', 'sidekiq 4.1.4 gitlab [0 of 25 busy]']) end it 'does fail gracefully on line not matching the format' do line = '55137 10.0 2.1 S+ 2:30pm something' parts = helper.parse_sidekiq_ps(line) + expect(parts).to eq(['?', '?', '?', '?', '?', '?']) end end |