Sha256: c354e66c639af0d1e570e121d16c0ea22112bcc36a0ea5e74f3122433bc4f1fb

Contents?: true

Size: 622 Bytes

Versions: 3

Compression:

Stored size: 622 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Yardstick::Rules::ApiTag::Inclusion, '#valid?' do
  subject { described_class.new(document).valid? }

  let(:document) { double('document') }

  %w[public semipublic private].each do |method_visibility|
    context "with #{method_visibility} method" do
      before do
        document.stub(:tag_text).with('api').and_return(method_visibility)
      end

      it { should be(true) }
    end
  end

  context 'with unknown method visibility' do
    before do
      document.stub(:tag_text).with('api').and_return('unknown')
    end

    it { should be(false) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yardstick-0.9.9 spec/unit/yardstick/rules/api_tag/inclusion/valid_predicate_spec.rb
yardstick-0.9.8 spec/unit/yardstick/rules/api_tag/inclusion/valid_predicate_spec.rb
yardstick-0.9.7 spec/unit/yardstick/rules/api_tag/inclusion/valid_predicate_spec.rb