Sha256: 5b5e014a9ae4a6ed912583b3811727ed466eb1ee37805da42d4e36729dd55699

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Yardstick::Rules::ExampleTag, '#validatable?' do
  subject { described_class.new(document).validatable? }

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

  before do
    document.stub(:api?).with(['private']) { false }
    document.stub(:tag_types).with('return') { %w[Object] }
  end

  it { should be(true) }

  context 'with private api' do
    before do
      document.stub(:api?).with(['private']).and_return(true)
    end

    it { should be(false) }
  end

  context 'with undefined return' do
    before do
      document.stub(:tag_types).with('return').and_return(['undefined'])
    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/example_tag/validatable_predicate_spec.rb
yardstick-0.9.8 spec/unit/yardstick/rules/example_tag/validatable_predicate_spec.rb
yardstick-0.9.7 spec/unit/yardstick/rules/example_tag/validatable_predicate_spec.rb