Sha256: 84dea1b4b0eb7ac98c7d80d6ec0925ad155fc81a97f5c93d9da3f7f3d3bc3129

Contents?: true

Size: 589 Bytes

Versions: 4

Compression:

Stored size: 589 Bytes

Contents

require 'spec_helper'
module Alf
  describe Renaming, "coerce" do

    subject{ Renaming.coerce(arg) }
    let(:expected){ Renaming.new(:old1 => :new1, :old2 => :new2) }

    describe "from a Renaming" do
      let(:arg){ Renaming.new(:old1 => :new1, :old2 => :new2) }
      it{ should eq(expected) }
    end

    describe "from a Hash" do
      let(:arg){ {"old1" => "new1", "old2" => "new2"} }
      it{ should eq(expected) }
    end

    describe "from an Array" do
      let(:arg){ ["old1", "new1", "old2", "new2"] }
      it{ should eq(expected) }
    end

  end # Renaming
end # Alf

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-types/renaming/test_coerce.rb
alf-core-0.14.0 spec/unit/alf-types/renaming/test_coerce.rb
alf-core-0.13.1 spec/unit/alf-types/renaming/test_coerce.rb
alf-core-0.13.0 spec/unit/alf-types/renaming/test_coerce.rb