Sha256: 43c6e66a1f12cb2fd74fa80be6a0e380d35024dd4cf26ef30132555ab558b4b7

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 Bytes

Contents

require "inheritable_accessors/inheritable_hash_accessor"

module SerialSpec
  module ItExpects
    extend ActiveSupport::Concern
    include InheritableAccessors::InheritableHashAccessor

    included do
      include ::SerialSpec::ItExpects::DSL
      extend  ::SerialSpec::ItExpects::DSL

      inheritable_hash_accessor :__inherited_expectations__

      after(:each) do
        __inherited_expectations__.to_hash.each do |name, block|
          instance_exec(&block)
        end
      end

    end

    module DSL

      def it_expects(name, &block)
        __inherited_expectations__[name] = block
      end

    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
serial-spec-0.4.1 lib/serial_spec/it_expects.rb
serial-spec-0.4.0 lib/serial_spec/it_expects.rb
serial-spec-0.3.1 lib/serial_spec/it_expects.rb
serial-spec-0.3.0 lib/serial_spec/it_expects.rb
serial-spec-0.2.1 lib/serial_spec/it_expects.rb
serial-spec-0.2.0 lib/serial_spec/it_expects.rb
serial-spec-0.1.1 lib/serial_spec/it_expects.rb
serial-spec-0.1.0 lib/serial_spec/it_expects.rb