Skip to content

Commit 710ddc4

Browse files
committed
Revert "Update tests to work for ruby 1.9"
This reverts commit 553dbbb.
1 parent 553dbbb commit 710ddc4

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

spec/file_info_spec.rb

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,44 @@
11
RSpec.describe(Jekyll::Compose::FileInfo) do
2-
let(:open_and_closing_tag) { "---\n" }
3-
let(:layout_content) { "post\n" }
4-
52
describe '#content' do
63
context 'with a title of only words' do
7-
let(:expected_title) { "A test arg parser\n" }
8-
subject { described_class.new Jekyll::Compose::ArgParser.new(
4+
let(:expected_result) {<<-CONTENT.gsub(/^\s+/, '')
5+
---
6+
layout: post
7+
title: A test arg parser
8+
---
9+
CONTENT
10+
}
11+
12+
let(:parsed_args) { Jekyll::Compose::ArgParser.new(
913
['A test arg parser'],
1014
{}
1115
)
1216
}
1317

1418
it 'does not wrap the title in quotes' do
15-
expect(subject.content).to start_with(open_and_closing_tag)
16-
expect(subject.content).to end_with(open_and_closing_tag)
17-
expect(subject.content).to match(layout_content)
18-
expect(subject.content).to match(expected_title)
19+
file_info = described_class.new parsed_args
20+
expect(file_info.content).to eq(expected_result)
1921
end
2022
end
2123

2224
context 'with a title that includes a colon' do
23-
let(:expected_title) { "'A test: arg parser'\n" }
24-
subject { described_class.new Jekyll::Compose::ArgParser.new(
25+
let(:expected_result) {<<-CONTENT.gsub(/^\s+/, '')
26+
---
27+
layout: post
28+
title: 'A test: arg parser'
29+
---
30+
CONTENT
31+
}
32+
33+
let(:parsed_args) { Jekyll::Compose::ArgParser.new(
2534
['A test: arg parser'],
2635
{}
2736
)
2837
}
2938

3039
it 'does wrap the title in quotes' do
31-
expect(subject.content).to start_with(open_and_closing_tag)
32-
expect(subject.content).to end_with(open_and_closing_tag)
33-
expect(subject.content).to match(layout_content)
34-
expect(subject.content).to match(expected_title)
40+
file_info = described_class.new parsed_args
41+
expect(file_info.content).to eq(expected_result)
3542
end
3643
end
3744
end

0 commit comments

Comments
 (0)