-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging.feature
57 lines (54 loc) · 3.24 KB
/
logging.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Feature: Allow logging
In order to facilitate maintenance
As a developer
I need the ability to log the performed activities
Background:
Given an empty file named "file.cpp.erb"
Given an empty file named "dir/file.cpp.erb"
Given an empty file named "dir/another_file.js.erb"
Given an empty file named "another_dir/features/file.feature.erb"
Given an empty file named "another_dir/file.java.erb"
Scenario: Processor is silent on the console by default
When I successfully run `erb-processor .`
Then the output should not contain anything
And a file named "erb-processor.log" should contain exactly:
"""
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""
Scenario: Processor logs info to the console
When I successfully run `erb-processor --log-level=info .`
Then the stdout should contain exactly:
"""
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""
And a file named "erb-processor.log" should contain exactly:
"""
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""