Sha256: e5a7471b99e99b4356bc9c07a962af9322e2315a5a223225c7eabb57cb2cb6a3

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Caramelize::AddNewlineOnPageEnd do
  describe '#run' do
    subject(:run) { filter.run }

    let(:filter) { described_class.new(body) }

    context 'with newline on body end' do
      let(:body) { "Here is a sample body\n" }

      it 'adds no newline character' do
        expect(run).to eq "Here is a sample body\n"
      end
    end

    context 'without newline on body end' do
      let(:body) { 'Here is a sample body' }

      it 'adds newline character' do
        expect(run).to eq "Here is a sample body\n"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caramelize-1.2.0 spec/lib/caramelize/filters/add_newline_on_page_end_spec.rb