Sha256: b3e7b89a3a70ca0f4aeb7cddaeb9b553466bb406684f6295aca71d8f8e8dadbc

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

shared_examples_for 'graph_uri_long_metrics' do
  it { subject.should match(/(\?|&)t=c(&|$)/) }
  it_should_behave_like 'graph_uri_params_fromto'
  it_should_behave_like 'graph_uri_params_widthheight'
end

shared_examples_for 'graph_uri_short_metrics' do
  it { subject.should match(/(\?|&)t=sc(&|$)/) }
  it_should_behave_like 'graph_uri_params_fromto'
  it_should_behave_like 'graph_uri_params_widthheight'
end

shared_examples_for 'graph_uri_params' do
  it_should_behave_like 'graph_uri_params_term'
  it_should_behave_like 'graph_uri_params_widthheight'
end

shared_examples_for 'graph_uri_params_term' do
  it { subject.should match(/(\?|&)t=#{params['t']}(&|$)/) }
end

shared_examples_for 'graph_uri_params_widthheight' do
  it { subject.should match(/(\?|&)width=#{params['width'].to_s}(&|$)/) }
  it { subject.should match(/(\?|&)height=#{params['height'].to_s}(&|$)/) }
end

shared_examples_for 'graph_uri_params_fromto' do
  it { subject.should match(/(\?|&)from=#{Regexp.escape(URI.escape(params['from'].to_s))}(&|$)/) }
  it { subject.should match(/(\?|&)to=#{Regexp.escape(URI.escape(params['to'].to_s))}(&|$)/) }
end

shared_examples_for 'graph_uri_empty_params' do
  it { subject.should_not match(/(\?|&)/) }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
multiforecast-client-0.80.0.3 lib/multiforecast/shared_examples.rb
multiforecast-client-0.80.0.2 lib/multiforecast/shared_examples.rb
multiforecast-client-0.80.0.1 lib/multiforecast/shared_examples.rb
multiforecast-client-0.80.0.0 lib/multiforecast/shared_examples.rb
multiforecast-client-0.72.0.1 lib/multiforecast/shared_examples.rb
multiforecast-client-0.62.0.8 lib/multiforecast/shared_examples.rb