Sha256: c94fb40dc7efef72f2c03e8db6e4b847549592443126ee5def622cebca2274d5

Contents?: true

Size: 752 Bytes

Versions: 4

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'
module Alf
  class Renderer
    describe Rash do

      context 'the class' do
        subject{ Rash }

        it_should_behave_like "a Renderer class"
      end

      context 'an instance' do
        subject{ Rash.new(input).execute("") }

        context "when a Relation" do
          let(:input){ Relation(id: [1, 2]) }
          let(:expected){ "{:id => 1}\n{:id => 2}\n" }

          it 'outputs as expected' do
            subject.should eq(expected)
          end
        end

        context "when a Hash" do
          let(:input){ {id: 1} }
          let(:expected){ "{:id => 1}\n" }

          it 'outputs as expected' do
            subject.should eq(expected)
          end
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-io/renderer/test_rash.rb
alf-core-0.14.0 spec/unit/alf-io/renderer/test_rash.rb
alf-core-0.13.1 spec/unit/alf-io/renderer/test_rash.rb
alf-core-0.13.0 spec/unit/alf-io/renderer/test_rash.rb