Sha256: ec85ed796aacee64b782f65afb2cb088e5b3ec8a8d3a11dfe475060139e02dbb

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 Bytes

Contents

require File.dirname(__FILE__) + "/../spec_helper"

describe "Event handling" do



  describe "for precompiled CLR classes" do

    before do
      @warrior = ClrModels::ExposingWarrior.new
    end

    it "should subscribe to an event" do
      ClrModels::ExposedChangedSubscriber.new(@warrior)
      @warrior.has_event_subscriptions.should be_true
    end

    it "should not raise an error when subcribing to an event" do
      lambda { ClrModels::ExposedChangedSubscriber.new(@warrior) }.should_not raise_error
    end

    it "should handle an event when raised" do
      subscriber = ClrModels::ExposedChangedSubscriber.new(@warrior)
      @warrior.change_is_exposed
      subscriber.counter.should == 1
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caricature-0.7.7 spec/rspec/unit/interop_spec.rb
caricature-0.7.6 spec/rspec/unit/interop_spec.rb