require 'spec_helper' # This schema is a valid XML schema for Mondrian # # # # # # # #
# # # # # # # # describe 'A simple Mondrian XML Schema' do let(:described_class) { ::Rubiks::Schema } let(:schema_hash) { { 'cubes' => [{ 'name' => 'transactions', 'measures' => [ { 'name' => 'amount', 'aggregator' => 'sum', 'format_string' => '$#,###' } ], 'dimensions' => [ { 'name' => 'date', 'hierarchies' => [{ 'name' => 'year_quarter_month', 'levels' => [ { 'name' => 'year', 'type' => 'numeric' }, { 'name' => 'quarter', 'type' => 'numeric' }, { 'name' => 'month', 'type' => 'numeric' } ] }] } ] }] } } subject { described_class.new_from_hash(schema_hash) } describe '#to_xml' do it 'renders XML' do subject.to_xml.should be_like <<-XML
XML end end end