hq-dev 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/gem-versions +1 -1
- data/features/temp-dir.feature +36 -1
- data/lib/hq/cucumber/temp-dir.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad42d04f4d6edcdca3ebfc869a8e505ab0a4167c
|
4
|
+
data.tar.gz: b5b17bdb9cc271d1972e7aed0c3d69c38b694a6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9261497526accacc67bba022039f2417950477f2c0670c7b6fbb2bdab331c0d8ad14c7cba6b198cebccdca8f76fa4615f22fe92ada7990d86fe2a3c723db1b2
|
7
|
+
data.tar.gz: abb29a0030b6ad549b44a13b6c797c370bf8b5882020ed04dcdbf2c11fea1719ea40d2ecee01e3feb3a2c912302a67150144fbf63133dff1d5cf26ef9cbaa064
|
data/data/gem-versions
CHANGED
data/features/temp-dir.feature
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
Feature: Temporary directory and files
|
2
2
|
|
3
|
-
|
3
|
+
Background:
|
4
4
|
|
5
5
|
Given a file "features/support/env.rb":
|
6
6
|
"""
|
7
7
|
require "hq/cucumber/temp-dir"
|
8
8
|
"""
|
9
|
+
|
10
|
+
Scenario: Create a file
|
11
|
+
|
9
12
|
Given a file "features/support/steps.rb":
|
10
13
|
"""
|
11
14
|
Then /^the file is created correctly$/ do
|
12
15
|
File.read("abc.def").should == "Hello world"
|
13
16
|
end
|
14
17
|
"""
|
18
|
+
|
15
19
|
And a file "features/test.feature":
|
16
20
|
"""
|
17
21
|
Feature:
|
@@ -31,3 +35,34 @@ Feature: Temporary directory and files
|
|
31
35
|
1 scenario (1 passed)
|
32
36
|
2 steps (2 passed)
|
33
37
|
"""
|
38
|
+
|
39
|
+
Scenario: Create a directory
|
40
|
+
|
41
|
+
Given a file "features/support/steps.rb":
|
42
|
+
"""
|
43
|
+
Then /^the directory exists$/ do
|
44
|
+
Dir.exist?("some-dir").should be_true
|
45
|
+
end
|
46
|
+
Then /^the directory does not exist$/ do
|
47
|
+
Dir.exist?("some-dir").should be_false
|
48
|
+
end
|
49
|
+
"""
|
50
|
+
|
51
|
+
And a file "features/test.feature":
|
52
|
+
"""
|
53
|
+
Feature:
|
54
|
+
Scenario: Create dir
|
55
|
+
Given a directory "some-dir"
|
56
|
+
Then the directory exists
|
57
|
+
Scenario: Remove between runs
|
58
|
+
Then the directory does not exist
|
59
|
+
"""
|
60
|
+
|
61
|
+
When I run "cucumber"
|
62
|
+
|
63
|
+
Then the exit status should be 0
|
64
|
+
And the output should contain:
|
65
|
+
"""
|
66
|
+
2 scenarios (2 passed)
|
67
|
+
3 steps (3 passed)
|
68
|
+
"""
|
data/lib/hq/cucumber/temp-dir.rb
CHANGED
@@ -18,7 +18,7 @@ After do
|
|
18
18
|
|
19
19
|
end
|
20
20
|
|
21
|
-
Given /^a file "(
|
21
|
+
Given /^a file "(.+)":$/ do
|
22
22
|
|file_name, file_contents|
|
23
23
|
|
24
24
|
dir_name = File.dirname file_name
|
@@ -33,3 +33,10 @@ Given /^a file "(.*?)":$/ do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
36
|
+
|
37
|
+
Given /^a directory "(.+)"$/ do
|
38
|
+
|dir_name|
|
39
|
+
|
40
|
+
Dir.mkdir dir_name
|
41
|
+
|
42
|
+
end
|