Initial support for DayOne integration testing

This commit is contained in:
Manuel Ebert 2013-08-17 11:59:51 -07:00
parent 1a31c10ca7
commit 0fa981357e
7 changed files with 176 additions and 1 deletions

View file

@ -0,0 +1,14 @@
{
"default_hour": 9,
"timeformat": "%Y-%m-%d %H:%M",
"linewrap": 80,
"encrypt": false,
"editor": "",
"default_minute": 0,
"highlight": true,
"password": "",
"journals": {
"default": "features/journals/dayone.dayone"
},
"tagsymbols": "@"
}

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Creation Date</key>
<date>2013-05-17T18:39:20Z</date>
<key>Creator</key>
<dict>
<key>Device Agent</key>
<string>Macintosh/MacBookAir5,2</string>
<key>Generation Date</key>
<date>2013-08-17T18:39:20Z</date>
<key>Host Name</key>
<string>Egeria</string>
<key>OS Agent</key>
<string>Mac OS X/10.8.4</string>
<key>Software Agent</key>
<string>Day One (Mac)/1.8</string>
</dict>
<key>Entry Text</key>
<string>This entry has tags!</string>
<key>Starred</key>
<false/>
<key>Tags</key>
<array>
<string>work</string>
<string>play</string>
</array>
<key>Time Zone</key>
<string>America/Los_Angeles</string>
<key>UUID</key>
<string>044F3747A38546168B572C2E3F217FA2</string>
</dict>
</plist>

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Creation Date</key>
<date>2013-06-17T18:38:29Z</date>
<key>Creator</key>
<dict>
<key>Device Agent</key>
<string>Macintosh/MacBookAir5,2</string>
<key>Generation Date</key>
<date>2013-08-17T18:38:29Z</date>
<key>Host Name</key>
<string>Egeria</string>
<key>OS Agent</key>
<string>Mac OS X/10.8.4</string>
<key>Software Agent</key>
<string>Day One (Mac)/1.8</string>
</dict>
<key>Entry Text</key>
<string>This entry has a location.</string>
<key>Location</key>
<dict>
<key>Administrative Area</key>
<string>California</string>
<key>Country</key>
<string>Germany</string>
<key>Latitude</key>
<real>52.4979764</real>
<key>Locality</key>
<string>Berlin</string>
<key>Longitude</key>
<real>13.2404758</real>
<key>Place Name</key>
<string>Abandoned Spy Tower</string>
</dict>
<key>Starred</key>
<false/>
<key>Tags</key>
<array/>
<key>Time Zone</key>
<string>Europe/Berlin</string>
<key>UUID</key>
<string>0BDDD6CDA43C4A9AA2681517CC35AD9D</string>
</dict>
</plist>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Creation Date</key>
<date>2013-07-17T18:38:08Z</date>
<key>Creator</key>
<dict>
<key>Device Agent</key>
<string>Macintosh/MacBookAir5,2</string>
<key>Generation Date</key>
<date>2013-08-17T18:38:08Z</date>
<key>Host Name</key>
<string>Egeria</string>
<key>OS Agent</key>
<string>Mac OS X/10.8.4</string>
<key>Software Agent</key>
<string>Day One (Mac)/1.8</string>
</dict>
<key>Entry Text</key>
<string>This entry is starred!</string>
<key>Starred</key>
<true/>
<key>Tags</key>
<array/>
<key>Time Zone</key>
<string>America/Los_Angeles</string>
<key>UUID</key>
<string>422BC895507944A291E6FC44FC6B8BFC</string>
</dict>
</plist>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Creation Date</key>
<date>2013-08-17T18:37:50Z</date>
<key>Creator</key>
<dict>
<key>Device Agent</key>
<string>Macintosh/MacBookAir5,2</string>
<key>Generation Date</key>
<date>2013-08-17T18:37:50Z</date>
<key>Host Name</key>
<string>Egeria</string>
<key>OS Agent</key>
<string>Mac OS X/10.8.4</string>
<key>Software Agent</key>
<string>Day One (Mac)/1.8</string>
</dict>
<key>Entry Text</key>
<string>This is a DayOne entry.</string>
<key>Starred</key>
<false/>
<key>Tags</key>
<array/>
<key>UUID</key>
<string>4BB1F46946AD439996C9B59DE7C4DDC1</string>
</dict>
</plist>

17
features/dayone.feature Normal file
View file

@ -0,0 +1,17 @@
Feature: DayOne Ingetration
Scenario: Loading a DayOne Journal
Given we use the config "dayone.json"
When we run "jrnl -until now"
Then we should get no error
and the output should be
"""
2013-05-17 11:39 This entry has tags!
2013-06-17 20:38 This entry has a location.
2013-07-17 11:38 This entry is starred!
2013-08-17 11:37 This is a DayOne entry.
"""

View file

@ -18,7 +18,11 @@ def before_scenario(context, scenario):
if not os.path.exists(working_dir): if not os.path.exists(working_dir):
os.mkdir(working_dir) os.mkdir(working_dir)
for filename in os.listdir(original): for filename in os.listdir(original):
shutil.copy2(os.path.join(original, filename), working_dir) source = os.path.join(original, filename)
if os.path.isdir(source):
shutil.copytree(source, os.path.join(working_dir, filename))
else:
shutil.copy2(source, working_dir)
def after_scenario(context, scenario): def after_scenario(context, scenario):
"""After each scenario, restore all test data and remove working_dirs.""" """After each scenario, restore all test data and remove working_dirs."""