spec/ruco/application_spec.rb in ruco-0.0.49 vs spec/ruco/application_spec.rb in ruco-0.0.50

- old
+ new

@@ -323,9 +323,29 @@ File.write(rucorc, "Ruco.configure{ options.history_entries = 10 }") app.send(:editor).send(:text_area).instance_eval{@history}.instance_eval{@options[:entries]}.should == 10 end end + describe 'select mode' do + it "turns move commands into select commands" do + write('abc') + type :'Ctrl+b', :right, :right, 'a' + editor_part(app.view).should == "ac\n\n" + end + + it "stops after first non-move command" do + write('abc') + type :'Ctrl+b', :right, 'd', :right, 'e' + editor_part(app.view).should == "dbec\n\n" + end + + it "stops after hitting twice" do + write('abc') + type :'Ctrl+b', :'Ctrl+b', :right, 'd' + editor_part(app.view).should == "adbc\n\n" + end + end + describe :save do it "just saves" do write('') app.key('x') app.key(:'Ctrl+s')