spec/parser_spec.rb in NATO-0.0.2 vs spec/parser_spec.rb in NATO-0.0.3

- old
+ new

@@ -6,30 +6,38 @@ describe "#natify" do Then { parser.should respond_to :natify } describe "short sentence without numbers" do + Given(:result) { [[:Alfa, :"AL-FAH"], [:Bravo, :"BRAH-VOH"], [:Charlie, :"CHAR-LEE"], [:Delta, :"DELL-TAH"], [:Echo, :"ECK-OH"]] } + When(:nato) { parser.natify 'abcde' } - Then { nato.should == 'Alfa Bravo Charlie Delta Echo' } + Then { nato.should == result } end - describe "short sentence with numbers" do + describe "short sentence" do + Given(:result) { [[:Seven, :"SEV-EN"], [:Tango, :"TANG-GO"], [:Papa, :"PAH-PAH"], [:Three, :TREE], [:November, :"NO-VEM-BER"], [:Yankee, :"YANG-KEY"]] } + When(:nato) { parser.natify '7tp3ny' } - Then { nato.should == '7 Tango Papa 3 November Yankee' } + Then { nato.should == result } end - describe "medium sentence without numbers" do + describe "medium sentence" do + Given(:result) { [[:Mike, :MIKE], [:Lima, :"LEE-MAH"], [:Oscar, :"OSS-CAH"], [:Zulu, :"ZOO-LOO"], [:Juliett, :"JEW-LEE-ETT"], [:Uniform, :"YOU-NEE-FORM"], [:Whiskey, :"WISS-KEY"], [:Sierra, :"SEE-AIR-RAH"], [:Whiskey, :"WISS-KEY"], [:Kilo, :"KEY-LOH"], [:Romeo, :"ROW-ME-OH"], [:Hotel, :"HOH-TEL"], [:Foxtrot, :"FOKS-TROT"]] } + When(:nato) { parser.natify 'mlozjuwswkrhf' } - Then { nato.should == 'Mike Lima Oscar Zulu Juliett Uniform Whiskey Sierra Whiskey Kilo Romeo Hotel Foxtrot' } + Then { nato.should == result } end - describe "medium sentence with numbers" do + describe "medium sentence" do + Given(:result) { [[:Mike, :MIKE], [:Lima, :"LEE-MAH"], [:Zero, :"ZEE-RO"], [:One, :WUN], [:Juliett, :"JEW-LEE-ETT"], [:Uniform, :"YOU-NEE-FORM"], [:Whiskey, :"WISS-KEY"], [:Sierra, :"SEE-AIR-RAH"], [:Eight, :AIT], [:Four, :"FOW-ER"], [:Six, :SIX], [:Hotel, :"HOH-TEL"], [:Foxtrot, :"FOKS-TROT"]] } + When(:nato) { parser.natify 'ml01juws846hf' } - Then { nato.should == 'Mike Lima 0 1 Juliett Uniform Whiskey Sierra 8 4 6 Hotel Foxtrot' } + Then { nato.should == result } end end end end \ No newline at end of file