Sha256: 96c73ad3b400abe22ffedbfdc61c54528194d7bf85e92559ec99c6ac10b45278

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

# encoding: utf-8

require_relative "faceter"

require "abstract_mapper/rspec" # examples under the test

describe "rspec examples" do

  include_context "Faceter"

  describe "Faceter::Rename" do

    let(:described_class) { Faceter::Rename }

    it_behaves_like :creating_immutable_node do
      let(:attributes) { { keys: {} } }
    end

    it_behaves_like :mapping_immutable_input do
      let(:attributes) { { keys: { foo: :bar } } }

      let(:input)      { { foo: :FOO, baz: :BAZ } }
      let(:output)     { { bar: :FOO, baz: :BAZ } }
    end

  end # describe Faceter::Rename

  describe "Faceter::List" do

    let(:described_class) { Faceter::List }

    it_behaves_like :creating_immutable_branch

  end # describe Faceter::List

  describe "Faceter::CompactLists" do

    let(:described_class) { Faceter::CompactLists }

    it_behaves_like :skipping_nodes do
      let(:input) { [Faceter::Rename.new(keys: {}), Faceter::List.new] }
    end

    it_behaves_like :optimizing_nodes do
      let(:input)  { [Faceter::List.new { [1] }, Faceter::List.new { [2] }] }
      let(:output) { Faceter::List.new { [1, 2] } }
    end

  end # describe Faceter::CompactLists

end # describe mapper definition

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abstract_mapper-0.0.2 spec/integration/rspec_examples_spec.rb