Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests ensuring editor is opened

  • Loading branch information...
commit 7db6b1abdbe556edfb05a90817890fb76620e735 1 parent 2822ff4
John Mair authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/test_pry_note.rb
15 test/test_pry_note.rb
View
@@ -19,6 +19,21 @@ def ping
end
describe "note add" do
+ describe "opens an editor when -m flag not provided" do
+ it 'should open the editor' do
+ used_editor = nil
+ Pry.config.editor = proc { used_editor = true; nil }
+ @t.process_command "note add PryNote::TestClass"
+ used_editor.should == true
+ end
+
+ it 'should save the note' do
+ Pry.config.editor = proc { nil }
+ @t.process_command "note add PryNote::TestClass"
+ PryNote.notes["PryNote::TestClass"].count.should == 1
+ end
+ end
+
describe "explicit object" do
it 'should add a new note for a method (bound method)' do
@t.process_command "note add Pad.obj.ping -m 'my note'"
Please sign in to comment.
Something went wrong with that request. Please try again.