Sha256: d1f6336cbb7b2d58a9237256a011b0eff449e7c98fec088540abdadc43540137
Contents?: true
Size: 1013 Bytes
Versions: 3
Compression:
Stored size: 1013 Bytes
Contents
# frozen_string_literal: true module SupportHttp def message_count(topic) topic_stats = JSON.parse(FastlyNsq::Http::Nsqd.stats(topic: topic).body)["topics"].first || {} topic_stats["message_count"] end def create_topic(topic) FastlyNsq::Http::Nsqd.topic_create(topic: topic).code == 200 end def empty_topic(topic) FastlyNsq::Http::Nsqd.topic_empty(topic: topic).code == 200 end def delete_topic(topic) FastlyNsq::Http::Nsqd.topic_delete(topic: topic).code == 200 end def delete_channel(topic, channel) FastlyNsq::Http::Nsqd.channel_delete(topic: topic, channel: channel).code == 200 end def create_channel(topic, channel) FastlyNsq::Http::Nsqd.channel_create(topic: topic, channel: channel).code == 200 end def reset_topic(topic, channel: nil) delete_channel(topic, channel) if channel delete_topic(topic) create_topic(topic) create_channel(topic, channel) if channel end end RSpec.configure { |config| config.include(SupportHttp) }
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fastly_nsq-1.18.1 | spec/support/http.rb |
fastly_nsq-1.18.0 | spec/support/http.rb |
fastly_nsq-1.17.1 | spec/support/http.rb |