Sha256: 2be10fac07881eeb8443abf0f62fa03ada6396bc0198926dcfbb296095acedad

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe GrowthForecast::CLI do
  include_context "setup_growthforecast_client"
  before(:all) { @cli = GrowthForecast::CLI.new }

  context "#split_path" do
    context 'list service url' do
      before { @url = 'http://localhost/list/service_name?t=sh' }
      before { @service_name, @section_name, @graph_name = @cli.split_path(URI.parse(@url).path) }
      it { @service_name.should == 'service_name' }
      it { @section_name.should be_nil }
      it { @graph_name.should be_nil }
    end

    context 'list section url' do
      before { @url = 'http://localhost/list/service_name/section_name?t=sh' }
      before { @service_name, @section_name, @graph_name = @cli.split_path(URI.parse(@url).path) }
      it { @service_name.should == 'service_name' }
      it { @section_name.should == 'section_name' }
      it { @graph_name.should be_nil }
    end

    context 'view_graph url' do
      before { @url = 'http://localhost/view_graph/service_name/section_name/graph_name?t=sh' }
      before { @service_name, @section_name, @graph_name = @cli.split_path(URI.parse(@url).path) }
      it { @service_name.should == 'service_name' }
      it { @section_name.should == 'section_name' }
      it { @graph_name.should == 'graph_name' }
    end
  end

  context "delete_graph" do
    pending
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
growthforecast-client-0.82.5 spec/growthforecast/cli_spec.rb
growthforecast-client-0.82.4 spec/growthforecast/cli_spec.rb
growthforecast-client-0.82.3 spec/growthforecast/cli_spec.rb
growthforecast-client-0.82.2 spec/growthforecast/cli_spec.rb
growthforecast-client-0.82.1 spec/growthforecast/cli_spec.rb
growthforecast-client-0.80.2 spec/growthforecast/cli_spec.rb
growthforecast-client-0.80.1 spec/growthforecast/cli_spec.rb
growthforecast-client-0.80.0 spec/growthforecast/cli_spec.rb
growthforecast-client-0.62.4 spec/growthforecast/cli_spec.rb
growthforecast-client-0.62.3 spec/growthforecast/cli_spec.rb
growthforecast-client-0.62.0 spec/growthforecast/cli_spec.rb
growthforecast-client-0.0.6 spec/growthforecast/cli_spec.rb
growthforecast-client-0.0.5 spec/growthforecast/cli_spec.rb
growthforecast-client-0.0.4 spec/growthforecast/cli_spec.rb