spec/lib/yuyi/cli_spec.rb in yuyi-0.0.3 vs spec/lib/yuyi/cli_spec.rb in yuyi-0.0.6

- old
+ new

@@ -134,9 +134,14 @@ it 'should accept multiple text arguments' do CliTest.write_to_file 'test', 'arg1', 'arg2' expect(File.open('test').read).to eq "foo\narg1\narg2\n" end + + it 'should not add a line if it already exists' do + CliTest.write_to_file 'test', 'foo' + expect(File.open('test').read).to eq "foo\n" + end end describe '#delete_from_file' do before do CliTest.write_to_file 'test', 'foo', 'remove1', 'remove2', 'bar'