Sha256: b981663891aaa053abd95d9f180e8af0792d2985f0f07cd4f48c2e0b96e499d9
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe JekyllGithubSample::TextUtils do let(:text_utils) { class Tester; include JekyllGithubSample::TextUtils; end.new } context '#remove_common_indentation' do let(:lines) {[ ' def method', ' a = 1', ' end' ]} subject { text_utils.remove_common_indentation(lines) } it 'removes 3 spaces of common indentation' do should =~ [ 'def method', ' a = 1', 'end' ] end context 'for lines with no common indentation' do let(:lines) { [ 'def new_method', ' raise', 'end' ] } it 'does nothing to the indentation' do should =~ lines end end end context '#extract_tagged_lines' do let(:lines) { [ 'header', '[START tag]', 'content 1', 'content 2', '[END tag]', 'footer 1', 'footer 2' ] } subject { text_utils.extract_tagged_lines(lines, 'tag') } it 'extracts content' do should =~ [ 'content 1', 'content 2' ] end end end
Version data entries
3 entries across 3 versions & 1 rubygems