Permalink
Browse files

added tests ensuring editor is opened

  • Loading branch information...
1 parent 2822ff4 commit 7db6b1abdbe556edfb05a90817890fb76620e735 @banister committed Nov 30, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 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'"

0 comments on commit 7db6b1a

Please sign in to comment.