Skip to content

Commit

Permalink
Complete assignment TheOdinProject#3
Browse files Browse the repository at this point in the history
  • Loading branch information
missopi committed Aug 20, 2023
1 parent b0b8bc1 commit 51f68bf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions spec/16a_caesar_breaker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,24 @@
# Method with Outgoing Commands -> Test that the messages are sent
context 'when the directory exists' do
before do
allow(Dir).to receive(:exist?).and_return(true)
allow(File).to receive(:open)
allow(phrase).to receive(:display_file_location)
end

xit 'sends message to check the existance of the 16_cipher directory' do
it 'sends message to check the existance of the 16_cipher directory' do
expect(Dir).to receive(:exist?).with('16_cipher').once
phrase.save_decrypted_messages
end

xit 'does not send message to create a directory' do
it 'does not send message to create a directory' do
expect(Dir).not_to receive(:mkdir)
phrase.save_decrypted_messages
end

xit 'sends message to create a file' do
it 'sends message to create a file' do
expect(File).to receive(:open).once
phrase.save_decrypted_messages
end
end

Expand Down

0 comments on commit 51f68bf

Please sign in to comment.