require_relative './test_config' require 'helix_web_services_client' describe 'HelixWebServicesClient counters' do randstr = (0...8).map { (65 + rand(26)).chr }.join counter_1 = "#{randstr}_test_1" counter_2 = "#{randstr}_test_2" context '#set_counter' do it 'can create a numerical counter' do client_as_super do |c| c.set_counter(counter: counter_1, value: '1') end end it 'can create a text counter' do client_as_super do |c| c.set_counter(counter: counter_2, value: randstr) end end end context '#counters' do it 'can include our test counters in the list' do client_as_super do |c| counters = c.counters expect(counters.map(&:counter)).to include(counter_1) expect(counters.map(&:counter)).to include(counter_2) end end end context '#counter' do it 'can list our numerical counter' do client_as_super do |c| counter = c.counter(counter_1) expect(counter.value).to eq('1') end end it 'can list the text counter' do client_as_super do |c| counter = c.counter(counter_2) expect(counter.value).to eq(randstr) end end end context '#increment_counter' do it 'can increment the numerical counter' do client_as_super do |c| c.increment_counter(counter_1) counter = c.counter(counter_1) expect(counter.value).to eq('2') end end end context '#delete_counter' do it 'can delete our test counters' do client_as_super do |c| c.delete_counter(counter_1) c.delete_counter(counter_2) counters = c.counters expect(counters.map(&:counter)).to_not include(counter_1) expect(counters.map(&:counter)).to_not include(counter_2) end end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/spec/counters_spec.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec/counters_spec.rb | |||||
#2 | 15226 | tjuricek |
Fix reference to 'helix_web_services_client'. This works in the IDE which tends to glom together all deps at the top level. Ugh. |
||
#1 | 15225 | tjuricek |
Revise counter implementation, tests, and documentation Wasn't available in the Ruby client before, so, it's now available. |