Skip to content

Commit 7d14a29

Browse files
committed
Collapse some redundant tests in titleizer spec
1 parent 26b9f52 commit 7d14a29

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

spec/titleizer_spec.rb

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,22 @@
22
require "titleizer"
33

44
describe Titleizer do
5-
it 'uppercases rvm' do
6-
expect(Titleizer.title_for_page('rvm_is_a_thing')).to eq('RVM Is A Thing')
5+
it 'uppercases acronyms' do
6+
{
7+
'rvm_is_a_thing' => 'RVM Is A Thing',
8+
'ssh_into_all_the_things' => 'SSH Into All The Things',
9+
'CRUD_with_scaffolding' => 'CRUD With Scaffolding',
10+
'why_cant_my_vhs_play_this_dvd' => 'Why Cant My Vhs Play This DVD',
11+
'whats_the_deal_with_html' => 'Whats The Deal With HTML'
12+
}.each do |initial, expected|
13+
expect(Titleizer.title_for_page(initial)).to eq(expected)
14+
end
715
end
816

917
it 'uppercases osx as OS X' do
1018
expect(Titleizer.title_for_page('osx_ive_never_heard_of_it')).to eq('OS X Ive Never Heard Of It')
1119
end
1220

13-
it 'uppercases ssh' do
14-
expect(Titleizer.title_for_page('ssh_into_all_the_things')).to eq('SSH Into All The Things')
15-
end
16-
17-
it 'upcases CRUD, even if it is already uppercase' do
18-
expect(Titleizer.title_for_page('CRUD_with_scaffolding')).to eq('CRUD With Scaffolding')
19-
end
20-
21-
it 'uppercases dvd' do
22-
expect(Titleizer.title_for_page('why_cant_my_vhs_play_this_dvd')).to eq('Why Cant My Vhs Play This DVD')
23-
end
24-
25-
it 'uppercases html' do
26-
expect(Titleizer.title_for_page('whats_the_deal_with_html')).to eq('Whats The Deal With HTML')
27-
end
28-
2921
it 'uppercases argv' do
3022
expect(Titleizer.title_for_page('argv')).to eq('ARGV')
3123
end

0 commit comments

Comments
 (0)