Sha256: 4e07b69ce08f6b7549348bdd95af1c47f4b041652b2d9c744b078c68c072710e

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Caramelize::AddNewlineToPageEnd 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

2 entries across 2 versions & 1 rubygems

Version Path
caramelize-1.3.1 spec/lib/caramelize/filters/add_newline_to_page_end_spec.rb
caramelize-1.3.0 spec/lib/caramelize/filters/add_newline_to_page_end_spec.rb