No passing eval_str in edit_spec.rb
This commit is contained in:
parent
cc8bcb2ed0
commit
bef1b1972a
|
@ -234,8 +234,8 @@ describe "edit" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should edit the current expression if it's incomplete" do
|
it "should edit the current expression if it's incomplete" do
|
||||||
eval_str = 'def a'
|
@t.accept_line 'def a'
|
||||||
@t.process_command 'edit', eval_str
|
@t.process_command 'edit'
|
||||||
@contents.should == "def a\n"
|
@contents.should == "def a\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -250,14 +250,14 @@ describe "edit" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should use a blank file if -t given, even during an expression" do
|
it "should use a blank file if -t given, even during an expression" do
|
||||||
eval_str = 'def a;'
|
@t.accept_line 'def a;'
|
||||||
@t.process_command 'edit -t', eval_str
|
@t.process_command 'edit -t'
|
||||||
@contents.should == "\n"
|
@contents.should == "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should position the cursor at the end of the expression" do
|
it "should position the cursor at the end of the expression" do
|
||||||
eval_str = "def a; 2;\nend"
|
@t.eval "def a; 2;\nend"
|
||||||
@t.process_command 'edit', eval_str
|
@t.process_command 'edit'
|
||||||
@line.should == 2
|
@line.should == 2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -266,9 +266,8 @@ describe "edit" do
|
||||||
File.open(file, 'w'){|f| f << "'FOO'\n" }
|
File.open(file, 'w'){|f| f << "'FOO'\n" }
|
||||||
nil
|
nil
|
||||||
}
|
}
|
||||||
eval_str = ''
|
@t.process_command 'edit'
|
||||||
@t.process_command 'edit', eval_str
|
@t.eval_string.should == "'FOO'\n"
|
||||||
eval_str.should == "'FOO'\n"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not evaluate the expression with -n" do
|
it "should not evaluate the expression with -n" do
|
||||||
|
@ -276,9 +275,8 @@ describe "edit" do
|
||||||
File.open(file, 'w'){|f| f << "'FOO'\n" }
|
File.open(file, 'w'){|f| f << "'FOO'\n" }
|
||||||
nil
|
nil
|
||||||
}
|
}
|
||||||
eval_str = ''
|
@t.process_command 'edit -n'
|
||||||
@t.process_command 'edit -n', eval_str
|
@t.eval_string.should == ''
|
||||||
eval_str.should == ''
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue