Sha256: 43f7a9485e651d6a874ab35ea6b1fba34fbf5609735504118e68321436cfe29d

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

require 'spec_helper'

describe PrivatePlease, 'marking methods' do

  let(:storage) { PrivatePlease.storage }

  it('records the candidates and associate them to the owning class') do
    module Marking
      class Simple1
        def foo ; 'foo' end
        def bar ; 'bar' end
        def buz ; 'bar' end
        private_please  :bar, :buz
      end
    end
    storage.candidates['Marking::Simple1'].should == [:bar, :buz]
  end

  it('does not record invalid candidates (method not found in the class)') do
    module Marking
      class Simple2
        def foo ; 'foo' end
        private_please  :foo
        private_please  :invalid_method
      end
    end
    storage.candidates['Marking::Simple2'].should == [:foo]
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
private_please-0.0.2 spec/01_marking_methods_spec.rb