Sha256: 14f59bd385ba6860dd0cec22c16f4dcc8bca276fe20ce4356d1d7ea0b8410198

Contents?: true

Size: 595 Bytes

Versions: 7

Compression:

Stored size: 595 Bytes

Contents

require 'spec_helper'

describe Lionel::ExportBuilder do
  let(:builder) { described_class.new }

  describe "configure" do
    it "accepts block for column" do
      builder.configure do
        A { "123" }
      end

      builder.columns["A"].call.should eq("123")
    end

    it "accepts hard-coded value" do
      builder.configure do
        A "123"
      end

      builder.columns["A"].call.should eq("123")
    end

    it "raises error if not a column name (only letters)" do
      expect { builder.configure { x123 "123" } }.to raise_error(Lionel::ColumnNameError)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lionel_richie-0.3.1 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.3.0 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.2.4 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.2.3.1 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.2.3 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.2.1 spec/lib/lionel/export_builder_spec.rb
lionel_richie-0.2.0 spec/lib/lionel/export_builder_spec.rb