Sha256: 295fc3c4233e5406f445a84d5e8b94600a586a6d5dc4e0a6cc435033dd8dbfa3

Contents?: true

Size: 1.29 KB

Versions: 4

Compression:

Stored size: 1.29 KB

Contents

include ReportCat::Core

describe RSpec::Matchers, 'have_chart' do

  let( :name ) { :test }
  let( :type ) { :integer }
  let( :label ) { :label }
  let( :values ) { [] }
  let( :options ) { { :foo => true } }

  before( :each ) do
    @report = Report.new
    @chart = @report.add_chart( name, type, label, values, options )
  end

  it 'passes if the report has the chart' do
    expect( @report ).to have_chart( name )
    expect( @report ).to have_chart( name ).with_type( type )
    expect( @report ).to have_chart( name ).with_label( label )
    expect( @report ).to have_chart( name ).with_values( values )
    expect( @report ).to have_chart( name ).with_options( options )
    expect( @report ).to have_chart( name ).with_type( type ).with_label( label ).with_values( values ).with_options( options )
  end

  it 'fails if the report does not have the chart' do
    expect( @report ).to_not have_chart( :foo )
    expect( @report ).to_not have_chart( name ).with_type( :foo )
    expect( @report ).to_not have_chart( name ).with_label( :foo )
    expect( @report ).to_not have_chart( name ).with_values( :foo )
    expect( @report ).to_not have_chart( name ).with_options( :foo )
    expect( @report ).to_not have_chart( name ).with_type( :foo ).with_label( :foo ).with_values( :foo ).with_options( :foo )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
report_cat-5.0.3 spec/lib/report_cat/matchers/have_chart_spec.rb
report_cat-5.0.2 spec/lib/report_cat/matchers/have_chart_spec.rb
report_cat-5.0.1 spec/lib/report_cat/matchers/have_chart_spec.rb
report_cat-5.0.0 spec/lib/report_cat/matchers/have_chart_spec.rb