Sha256: 0d26f70cc6686a9bd08b8711f0e3b4f2c116d6b07771a9c24f077d47e7d87b0b

Contents?: true

Size: 783 Bytes

Versions: 11

Compression:

Stored size: 783 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Aspector::Base class methods" do
  it "before" do
    klass = Class.new(Aspector::Base) do
      before :test, :do_before
    end

    klass.send(:aop_advices).size.should == 1
    advice = klass.send(:aop_advices).first
    advice.before?.should be_true
    advice.options[:skip_if_false].should_not be_true
    advice.with_method.should == 'do_before'
  end

  it "before_filter" do
    klass = Class.new(Aspector::Base) do
      before_filter :test, :do_before
    end

    klass.send(:aop_advices).size.should == 1
    advice = klass.send(:aop_advices).first
    advice.before?.should be_true
    advice.options[:skip_if_false].should be_true
    advice.with_method.should == 'do_before'
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
aspector-0.12.3 spec/unit/base_class_methods_spec.rb
aspector-0.12.2 spec/unit/base_class_methods_spec.rb
aspector-0.12.1 spec/unit/base_class_methods_spec.rb
aspector-0.12.0 spec/unit/base_class_methods_spec.rb
aspector-0.11.1 spec/unit/base_class_methods_spec.rb
aspector-0.11.0 spec/unit/base_class_methods_spec.rb
aspector-0.10.1 spec/unit/base_class_methods_spec.rb
aspector-0.10.0 spec/unit/base_class_methods_spec.rb
aspector-0.9.1 spec/unit/base_class_methods_spec.rb
aspector-0.9.0 spec/unit/base_class_methods_spec.rb
aspector-0.8.0 spec/unit/base_class_methods_spec.rb