Class OSX::NSObject
In: lib/rucola/rucola_support/core_ext/objc/nsobject.rb
lib/rucola/test_case.rb
lib/rucola/test_helper.rb
Parent: Object

Methods

Included Modules

Rucola::InitializeHooks Rucola::Notifications

External Aliases

inherited -> _inherited_before_rucola
ib_outlets -> ib_outlet
ivar -> ib_outlet
  A mocha helper to get at an outlet (ivar) without having to use instance_variable_get.
  obj.ib_outlet(:some_text_view).expects(:string=).with('foo')

Public Class methods

An array of defined ib_outlets.

Only used in test cases.

A Mocha helper method which allocs an instance, yields it and then calls init.

  class Monkey < OSX::NSObject
    def init
      if super_init
        self.foo
        self.bar
        return self
      end
    end
  end

  it "should alloc, yield and return an instance" do
    obj = OSX::Monkey.during_init do |instance|
      instance.expects(:foo)
      instance.expects(:bar)
    end
    p obj # => #<Monkey:0x1a7566 class='Monkey' id=0x1b30a70>
  end

Results in: 1 tests, 2 assertions, 0 failures, 0 errors

A Mocha helper method which allows to stub alloc.init and return a mock.

  it "should init and return an instance" do
    obj_mock = mock("NSObject mock")
    OSX::NSObject.expects_alloc_init_returns(obj_mock) # performs 2 assertions
    OSX::NSObject.alloc.init.should == obj_mock
  end

Results in: 1 tests, 3 assertions, 0 failures, 0 errors

Override ib_outlets so we can store which ones need to be defined.

Only used in test cases.

[Validate]