Skip to content

Commit 85b6a15

Browse files
committed
Cucumber tests for status window
1 parent b05ef28 commit 85b6a15

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

features/correct_window_setup.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Feature: Correct window setup
33
As a user
44
I want to see correct watch, stack and status information
55

6+
Scenario: The status window
7+
Given I have a file example.php containing
8+
"""
9+
<?php
10+
$var1 = 1;
11+
?>
12+
"""
13+
When I start the debugger with the PHP script example.php
14+
Then the status should be break
15+
And the status window should contain localhost:9000
16+
617
Scenario: The watch window
718
Given I have a file example.php containing
819
"""
@@ -49,3 +60,5 @@ Feature: Correct window setup
4960
When I step in
5061
Then item 1 on the stack should show the file example2.php
5162
And item 1 on the stack should show line 2
63+
And item 2 on the stack should show the file example.php
64+
And item 2 on the stack should show line 2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Then "the status should be $status" do |status|
2+
vdebug.status.should == status
3+
end
4+
5+
Then "the status window should contain $string" do |string|
6+
vdebug.status_window_content.should include string
7+
end

rubylib/vdebug.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ def status_window_content
9494
fetch_buffer_content 'DebuggerStatus'
9595
end
9696

97+
def status
98+
/Status: (\S+)/.match(status_window_content)[1]
99+
end
100+
97101
protected
98102
def fetch_buffer_content(name)
99103
bufnum = buffers.invert.fetch(name)

0 commit comments

Comments
 (0)