Sha256: 8b08d6845249511c3fa910a67be239ace86cedf347bfe18e2001818912b8d6a2
Contents?: true
Size: 1012 Bytes
Versions: 9
Compression:
Stored size: 1012 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' module Quby::Questionnaires::DSL describe BarChartBuilder do it_behaves_like ChartBuilder let(:questionnaire) { double(key: 'questionnaire_key') } it 'makes a bar chart' do expect(dsl { }).to be_an_instance_of(::Quby::Questionnaires::Entities::Charting::BarChart) end def dsl(key = :test, options = {}, &block) builder = BarChartBuilder.new(questionnaire, key, options) builder.build(&block) end it 'sets y-axis range' do expect(dsl { range 0..40 }.y_range).to eq (0..40) end it 'sets y-axis tick interval' do expect(dsl { tick_interval 1 }.tick_interval).to eq 1 end it 'sets plotlines' do plotlines = dsl do plotline 40, :orange plotline 60, :red end.plotlines expect(plotlines).to eq [ {value: 40, color: :orange, width: 1, zIndex: 3}, {value: 60, color: :red, width: 1, zIndex: 3} ] end end end
Version data entries
9 entries across 9 versions & 1 rubygems