Sha256: bd1fa5b67bcdb392ffce21b8d3954633f25b63d6675940320dd17aa9e56e0b0d

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Jace::Registry do
  describe 'yard' do
    subject(:registry) { described_class.new }

    let(:context) { SomeContext.new }
    let(:expected_texts) do
      [
        'doing something before',
        'doing something middle',
        'doing something after'
      ]
    end

    it 'runs the event handlers' do
      registry.register(:the_event) { do_something(:after) }
      registry.register(:the_event, :before) { do_something(:before) }

      registry.trigger(:the_event, context) do
        context.do_something(:middle)
      end

      expect(context.text)
        .to eq(expected_texts)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jace-0.1.1 spec/integration/readme/jace/registry_spec.rb
jace-0.1.0 spec/integration/readme/jace/registry_spec.rb