insxsync 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/features/synchronization.feature +58 -58
- data/lib/insxsync/version.rb +1 -1
- data/lib/sync_point_collection.rb +1 -0
- metadata +1 -1
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
Feature: Synchronization
|
2
|
+
Background:
|
3
|
+
Given A configuration exists
|
4
|
+
#################################################
|
5
|
+
# Configuration Directory, Sync Point, and Database connection irrelevant
|
6
|
+
#################################################
|
7
7
|
# Scenario: User wants to sync (No Configs) (No Database)
|
8
8
|
# Given I am going to run the program
|
9
9
|
# And The database is running
|
@@ -60,58 +60,58 @@
|
|
60
60
|
# # Sync Point Exists
|
61
61
|
# # Database connection works
|
62
62
|
# #################################################
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
63
|
+
Scenario: User wants to sync (Configs) (No Database) (Default Sync Dir) (Default Date ID)
|
64
|
+
Given I am going to run the program
|
65
|
+
And The database is running
|
66
|
+
And Synchronization points exist
|
67
|
+
And Configurations exist at the default location
|
68
|
+
And I am going to run a sync
|
69
|
+
And I specify valid database credentials
|
70
|
+
And I input the following "Password001"
|
71
|
+
When I run the application
|
72
|
+
Then The synchronization should be successful
|
73
|
+
And The databases should be unchanged
|
74
|
+
And The config files should be updated
|
75
|
+
Scenario: User wants to sync (Configs) (No Database) (Default Sync Dir) (Specifies Date ID)
|
76
|
+
Given I am going to run the program
|
77
|
+
And The database is running
|
78
|
+
And Synchronization points exist
|
79
|
+
And Configurations exist at the default location
|
80
|
+
And I am going to run a sync
|
81
|
+
And I specify "--date-id 1"
|
82
|
+
And I specify valid database credentials
|
83
|
+
And I input the following "Password001"
|
84
|
+
When I run the application
|
85
|
+
Then The synchronization should be successful
|
86
|
+
And The databases should be unchanged
|
87
|
+
And The config files should be updated
|
88
|
+
Scenario: User wants to sync (Configs) (No Database) (Specifies Sync Dir) (Default Date ID)
|
89
|
+
Given I am going to run the program
|
90
|
+
And The database is running
|
91
|
+
And Synchronization points exist
|
92
|
+
And Configurations exist at "/tmp/insxsync"
|
93
|
+
And I am going to run a sync
|
94
|
+
And I specify "--sync-dir /tmp/insxsync"
|
95
|
+
And I specify valid database credentials
|
96
|
+
And I input the following "Password001"
|
97
|
+
When I run the application
|
98
|
+
Then The synchronization should be successful
|
99
|
+
And The databases should be unchanged
|
100
|
+
And The config files should be updated
|
101
|
+
Scenario: User wants to sync (Configs) (No Database) (Specifies Sync Dir) (Specifies Date ID)
|
102
|
+
Given I am going to run the program
|
103
|
+
And The database is running
|
104
|
+
And Synchronization points exist
|
105
|
+
And Configurations exist at "/tmp/insxsync"
|
106
|
+
And I am going to run a sync
|
107
|
+
And I specify "--date-id 1"
|
108
|
+
And I specify "--sync-dir /tmp/insxsync"
|
109
|
+
And I specify valid database credentials
|
110
|
+
And I input the following "Password001"
|
111
|
+
When I run the application
|
112
|
+
Then The synchronization should be successful
|
113
|
+
And The databases should be unchanged
|
114
|
+
And The config files should be updated
|
115
115
|
#
|
116
116
|
# Scenario: User wants to sync (No Configs) (Database) (Default Parameters) (Specifies Credentials) (Default Date ID)
|
117
117
|
# Given I am going to run the program
|
data/lib/insxsync/version.rb
CHANGED
@@ -81,6 +81,7 @@ class SyncPointCollection < ErrorHandlingIface
|
|
81
81
|
next unless obj.key =~ /(.*?)\.sql/
|
82
82
|
suffix = obj.key.scan(/\d*\/(.*)/).flatten[0]
|
83
83
|
filename = File.join(dir, suffix)
|
84
|
+
FileUtils.mkdir_p(File.dirname(filename))
|
84
85
|
File.open(filename, 'w') do |file|
|
85
86
|
file.write(data)
|
86
87
|
end
|