kronk 1.7.1 → 1.7.2
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/History.rdoc +1 -1
- data/lib/kronk.rb +1 -1
- data/lib/kronk/cmd.rb +3 -3
- data/lib/kronk/constants.rb +1 -1
- data/test/test_cmd.rb +16 -6
- data/test/test_kronk.rb +2 -2
- metadata +1 -1
data/History.rdoc
CHANGED
data/lib/kronk.rb
CHANGED
data/lib/kronk/cmd.rb
CHANGED
@@ -80,7 +80,7 @@ class Kronk
|
|
80
80
|
end
|
81
81
|
|
82
82
|
File.open Kronk::DEFAULT_CONFIG_FILE, "w+" do |file|
|
83
|
-
file <<
|
83
|
+
file << new_config.to_yaml
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -129,12 +129,12 @@ Parse and run diffs against data from live and cached http responses.
|
|
129
129
|
STR
|
130
130
|
|
131
131
|
opt.on('--ascii', 'Return ascii formatted diff') do
|
132
|
-
Kronk.config[:diff_format] =
|
132
|
+
Kronk.config[:diff_format] = 'ascii'
|
133
133
|
end
|
134
134
|
|
135
135
|
|
136
136
|
opt.on('--color', 'Return color formatted diff') do
|
137
|
-
Kronk.config[:diff_format] =
|
137
|
+
Kronk.config[:diff_format] = 'color'
|
138
138
|
end
|
139
139
|
|
140
140
|
|
data/lib/kronk/constants.rb
CHANGED
@@ -84,7 +84,7 @@ class Kronk
|
|
84
84
|
:context => 3,
|
85
85
|
:cookies_file => DEFAULT_COOKIES_FILE,
|
86
86
|
:default_host => "http://localhost:3000",
|
87
|
-
:diff_format =>
|
87
|
+
:diff_format => 'ascii',
|
88
88
|
:history_file => DEFAULT_HISTORY_FILE,
|
89
89
|
:indentation => 1,
|
90
90
|
:requires => [],
|
data/test/test_cmd.rb
CHANGED
@@ -75,7 +75,12 @@ class TestCmd < Test::Unit::TestCase
|
|
75
75
|
Kronk::Cmd.make_config_file
|
76
76
|
mock_file.rewind
|
77
77
|
|
78
|
-
|
78
|
+
new_config = {}
|
79
|
+
Kronk::DEFAULT_CONFIG.each do |key, value|
|
80
|
+
new_config[key.to_s] = value
|
81
|
+
end
|
82
|
+
|
83
|
+
assert_equal new_config.to_yaml, mock_file.read
|
79
84
|
end
|
80
85
|
|
81
86
|
|
@@ -89,7 +94,12 @@ class TestCmd < Test::Unit::TestCase
|
|
89
94
|
Kronk::Cmd.make_config_file
|
90
95
|
mock_file.rewind
|
91
96
|
|
92
|
-
|
97
|
+
new_config = {}
|
98
|
+
Kronk::DEFAULT_CONFIG.each do |key, value|
|
99
|
+
new_config[key.to_s] = value
|
100
|
+
end
|
101
|
+
|
102
|
+
assert_equal new_config.to_yaml, mock_file.read
|
93
103
|
end
|
94
104
|
|
95
105
|
|
@@ -162,13 +172,13 @@ class TestCmd < Test::Unit::TestCase
|
|
162
172
|
def test_parse_args_diff_format_mapping
|
163
173
|
with_config Hash.new do
|
164
174
|
opts = Kronk::Cmd.parse_args %w{uri --ascii}
|
165
|
-
assert_equal
|
175
|
+
assert_equal 'ascii', Kronk.config[:diff_format]
|
166
176
|
|
167
177
|
opts = Kronk::Cmd.parse_args %w{uri --color}
|
168
|
-
assert_equal :color_diff, Kronk.config[:diff_format]
|
169
|
-
|
170
|
-
opts = Kronk::Cmd.parse_args %w{uri --format color}
|
171
178
|
assert_equal 'color', Kronk.config[:diff_format]
|
179
|
+
|
180
|
+
opts = Kronk::Cmd.parse_args %w{uri --format color_diff}
|
181
|
+
assert_equal 'color_diff', Kronk.config[:diff_format]
|
172
182
|
end
|
173
183
|
end
|
174
184
|
|
data/test/test_kronk.rb
CHANGED
@@ -17,7 +17,7 @@ class TestKronk < Test::Unit::TestCase
|
|
17
17
|
:history_file => Kronk::DEFAULT_HISTORY_FILE,
|
18
18
|
:indentation => 1,
|
19
19
|
:default_host => "http://localhost:3000",
|
20
|
-
:diff_format =>
|
20
|
+
:diff_format => 'ascii',
|
21
21
|
:show_lines => false,
|
22
22
|
:use_cookies => true,
|
23
23
|
:requires => [],
|
@@ -72,7 +72,7 @@ class TestKronk < Test::Unit::TestCase
|
|
72
72
|
},
|
73
73
|
:context => 3,
|
74
74
|
:default_host => "http://localhost:3000",
|
75
|
-
:diff_format =>
|
75
|
+
:diff_format => 'ascii',
|
76
76
|
:cache_file => Kronk::DEFAULT_CACHE_FILE,
|
77
77
|
:cookies_file => Kronk::DEFAULT_COOKIES_FILE,
|
78
78
|
:history_file => Kronk::DEFAULT_HISTORY_FILE,
|