Sha256: 64b2a64d340a02ea829be7611c7ab57b83cbef837738b659365ae154619408b6

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

describe Lionel do
  TestCard = Struct.new(:id, :name, :url)

  describe "self.export" do
    it "configures the export builder" do
      card = TestCard.new(123, "Testing cards", "http://example.com")

      Lionel.export do
        A { id }
        B { name }
        C { url }
      end

      builder = Lionel::Export.builder

      card.instance_eval(&builder.columns["A"]).should eq(123)
      card.instance_eval(&builder.columns["B"]).should eq("Testing cards")
      card.instance_eval(&builder.columns["C"]).should eq("http://example.com")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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