Sha256: 73d24460db6e4723d7f81f7ed4437f751ee22eda804897ae228fcfcda9b38dfb

Contents?: true

Size: 1.62 KB

Versions: 25

Compression:

Stored size: 1.62 KB

Contents

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

describe ::Inch::API::Filter do
  before do
    @codebase = test_codebase(:simple)
  end

  it "should work" do
    @options = {}
    @context = ::Inch::API::Filter.new @codebase, @options
    refute @context.objects.empty?
    refute @context.grade_lists.empty?
  end

  it "should work with option: visibility == :public" do
    @options = {:visibility => [:public]}
    @context = ::Inch::API::Filter.new @codebase, @options
    assert @context.objects.all? { |o| o.public? }
  end

  it "should work with option: visibility == :protected" do
    @options = {:visibility => [:protected]}
    @context = ::Inch::API::Filter.new @codebase, @options
    assert @context.objects.all? { |o| o.protected? }
  end

  it "should work with option: visibility == :private" do
    @options = {:visibility => [:private]}
    @context = ::Inch::API::Filter.new @codebase, @options
    assert @context.objects.all? { |o| o.private? || o.tagged_as_private? }
  end

  it "should work with option: namespaces == :only" do
    @options = {:namespaces => :only}
    @context = ::Inch::API::Filter.new @codebase, @options
    assert @context.objects.all? { |o| o.namespace? }
  end

  it "should work with option: undocumented == :only" do
    @options = {:undocumented => :only}
    @context = ::Inch::API::Filter.new @codebase, @options
    assert @context.objects.all? { |o| o.undocumented? }
  end

  it "should work with option: depth == 2" do
    @options = {:depth => 2}
    @context = ::Inch::API::Filter.new @codebase, @options
    refute @context.objects.any? { |o| o.depth > 2 }
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
inch-0.5.0.rc3 test/unit/api/filter_test.rb
inch-0.5.0.rc2 test/unit/api/filter_test.rb
inch-0.5.0.rc1 test/unit/api/filter_test.rb
inch-0.4.6 test/unit/api/filter_test.rb
inch-0.4.5 test/unit/api/filter_test.rb
inch-0.4.4 test/unit/api/filter_test.rb
inch-0.4.4.rc4 test/unit/api/filter_test.rb
inch-0.4.4.rc3 test/unit/api/filter_test.rb
inch-0.4.4.rc2 test/unit/api/filter_test.rb
inch-0.4.4.rc1 test/unit/api/filter_test.rb
inch-0.4.3 test/unit/api/filter_test.rb
inch-0.4.3.rc2 test/unit/api/filter_test.rb
inch-0.4.3.rc1 test/unit/api/filter_test.rb
inch-0.4.2 test/unit/api/filter_test.rb
inch-0.4.1 test/unit/api/filter_test.rb
inch-0.4.0 test/unit/api/filter_test.rb
inch-0.4.0.rc3 test/unit/api/filter_test.rb
inch-0.4.0.rc2 test/unit/api/filter_test.rb
inch-0.4.0.rc1 test/unit/api/filter_test.rb
inch-0.3.4.rc1 test/unit/api/filter_test.rb