Sha256: 49ac537b4fdeaeb3089834b42a52dde96191ced84b608b7cec8beaa2b4e6332b

Contents?: true

Size: 751 Bytes

Versions: 4

Compression:

Stored size: 751 Bytes

Contents

require 'spec_helper'
module Alf
  describe "Relation" do

    let(:expected){ Alf::Relation([ {name: "Jones"} ]) }

    it 'works as expected on a tuple' do
      Alf::Relation(:name => "Jones").should eq(expected)
    end

    it 'works as expected on a Reader' do
      File.open(File.expand_path("../example.rash", __FILE__), "r") do |io|
        reader = Alf::Reader.rash(io)
        rel    = Alf::Relation(reader)
        rel.should eq(expected)
      end
    end

    it 'supports a Path to a recognized file' do
      Alf::Relation(Path.dir/'example.rash').should eq(expected)
    end

    it 'supports a String to a recognized file' do
      Alf::Relation(File.expand_path('../example.rash', __FILE__)).should eq(expected)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-core/alf/test_Relation.rb
alf-core-0.14.0 spec/unit/alf-core/alf/test_Relation.rb
alf-core-0.13.1 spec/unit/alf-core/alf/test_Relation.rb
alf-core-0.13.0 spec/unit/alf-core/alf/test_Relation.rb