spec/ruco/application_spec.rb in ruco-0.0.53 vs spec/ruco/application_spec.rb in ruco-0.0.54
- old
+ new
@@ -28,13 +28,16 @@
def type(*keys)
keys.each{|k| app.key k }
end
+ def status(line=1)
+ "Ruco #{Ruco::VERSION} -- spec/temp.txt #{line}:1\n"
+ end
+
let(:rucorc){ 'spec/.ruco.rb' }
let(:app){ Ruco::Application.new(@file, :lines => 5, :columns => 10, :rc => rucorc) }
- let(:status){ "Ruco #{Ruco::VERSION} -- spec/temp.txt \n" }
let(:command){ "^W Exit" }
it "renders status + editor + command" do
write("xxx\nyyy\nzzz")
app.view.should == "#{status}xxx\nyyy\nzzz\n#{command}"
@@ -44,11 +47,11 @@
app.key('2')
app.key('2')
app.key(:enter)
app.key('2')
app.key(:enter)
- app.view.should == "#{status.sub('.txt ','.txt*')}2\n\n\n#{command}"
+ app.view.should == "#{status(3).sub('.txt ','.txt*')}2\n\n\n#{command}"
end
it "does not enter key-codes" do
app.key(888)
app.view.should == "#{status}\n\n\n#{command}"
@@ -57,10 +60,10 @@
it "can execute a command" do
write("123\n456\n789\n")
app.key(:"Ctrl+g") # go to line
app.key('2') # 2
app.key(:enter)
- app.view.should == "#{status}123\n456\n789\n#{command}"
+ app.view.should == "#{status(2)}123\n456\n789\n#{command}"
app.cursor.should == [2,0] # 0 offset + 1 for statusbar
end
it "can resize" do
write("01234567\n1\n2\n3\n4\n5678910111213\n6\n7\n8")