mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Implement expression change test (per @rf-)
This commit is contained in:
parent
483728fcc7
commit
7ff98c60a4
1 changed files with 25 additions and 4 deletions
|
@ -38,10 +38,31 @@ describe "watch expression" do
|
|||
eval('watch').should =~ /=> :bar/
|
||||
end
|
||||
|
||||
#it "prints only when an expression changes" do
|
||||
# # TODO: This is one of the main features, but I am not sure how to test the
|
||||
# # output from a hook.
|
||||
#end
|
||||
it "prints when an expression changes" do
|
||||
ReplTester.start do
|
||||
input 'a = 1'
|
||||
output '=> 1'
|
||||
|
||||
input 'watch a'
|
||||
output "Watching a\nwatch: a => 1"
|
||||
|
||||
input "a = 2"
|
||||
output "watch: a => 2\n=> 2"
|
||||
end
|
||||
end
|
||||
|
||||
it "doesn't print when an expresison remains the same" do
|
||||
ReplTester.start do
|
||||
input 'a = 1'
|
||||
output '=> 1'
|
||||
|
||||
input 'watch a'
|
||||
output "Watching a\nwatch: a => 1"
|
||||
|
||||
input "a = 1"
|
||||
output "=> 1"
|
||||
end
|
||||
end
|
||||
|
||||
describe "deleting expressions" do
|
||||
before do
|
||||
|
|
Loading…
Reference in a new issue