Sha256: 9c7c5638b0a8fe2ac348e633a12ab6c534defb83df8a9d7116eb62fb34b7195e

Contents?: true

Size: 941 Bytes

Versions: 4

Compression:

Stored size: 941 Bytes

Contents

# -*- encoding: utf-8 -*-

shared_context "setup_growthforecast_client" do
  before(:all) { @client = GrowthForecast::Client.new('http://localhost:5125') }

  include_context "stub_list_graph" if ENV['MOCK'] == 'on'
  let(:graphs) { @client.list_graph }
  let(:graph) { graphs.first }

  include_context "stub_post_graph" if ENV['MOCK'] == 'on'
  include_context "stub_delete_graph" if ENV['MOCK'] == 'on'
  before(:all) {
    @client.delete_graph("app name", "host name", "<1sec count") rescue nil
    @client.delete_graph("app name", "host name", "<2sec count") rescue nil
    @client.post_graph("app name", "host name", "<1sec count", { 'number' => 0 }) rescue nil
    @client.post_graph("app name", "host name", "<2sec count", { 'number' => 0 }) rescue nil
  }
  after(:all) {
    @client.delete_graph("app name", "host name", "<1sec count") rescue nil
    @client.delete_graph("app name", "host name", "<2sec count") rescue nil
  }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
growthforecast-client-0.0.6 spec/support/setup.rb
growthforecast-client-0.0.5 spec/support/setup.rb
growthforecast-client-0.0.4 spec/support/setup.rb
growthforecast-client-0.0.3 spec/support/setup.rb