Sha256: 2f5821840f33b127e2b974fddac27bd764a22d415f6e2b0c8a35a746d15d26e1

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
multiforecast-client-0.62.0.5 lib/multiforecast/shared_examples.rb
multiforecast-client-0.62.0.3 lib/multiforecast/shared_examples.rb
multiforecast-client-0.62.0.2 lib/multiforecast/shared_examples.rb