Sha256: c97f4671b204b9c1e3993c57e5dda21f6b3e31206fb0c068f786302247f2e57d

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path('spec_helper', __dir__)

describe Danger::Changelog::ChangelogPlaceholderLine do
  context 'with a custom placeholder line' do
    before do
      Danger::Changelog.configure do |config|
        config.placeholder_line = "* Nothing yet here.\n"
      end
    end

    context 'when line is equal to placeholder_line from config' do
      it_behaves_like 'validates as changelog placeholder line', "* Nothing yet here.\n"
      it_behaves_like 'valid changelog placeholder line', "* Nothing yet here.\n"
    end

    context 'when line is not equal to placeholder_line from config' do
      it_behaves_like 'does not validate as changelog placeholder line', "* Put your contribution here.\n"
      it_behaves_like 'invalid changelog placeholder line', "* Put your contribution here.\n"
    end
  end

  context 'with a blank placeholder line' do
    before do
      Danger::Changelog.configure do |config|
        config.placeholder_line = nil
      end
    end

    context 'when line is not blank' do
      it_behaves_like 'does not validate as changelog placeholder line', "* Whatever.\n"
      it_behaves_like 'invalid changelog placeholder line', "* Whatever.\n"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danger-changelog-0.5.0 spec/changelog_placeholder_line_spec.rb
danger-changelog-0.4.2 spec/changelog_placeholder_line_spec.rb