grntest 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.0.1"
17
+ VERSION = "1.0.2"
18
18
  end
@@ -28,7 +28,7 @@ class TestExecutor < Test::Unit::TestCase
28
28
 
29
29
  private
30
30
  def execute(command)
31
- @script.print(command)
31
+ @script.puts(command)
32
32
  @script.close
33
33
  @executor.execute(Pathname(@script.path))
34
34
  end
@@ -36,20 +36,26 @@ class TestExecutor < Test::Unit::TestCase
36
36
  class TestComment < self
37
37
  def test_disable_logging
38
38
  assert_predicate(@context, :logging?)
39
- execute("# disable-logging")
39
+ execute("\#@disable-logging")
40
40
  assert_not_predicate(@context, :logging?)
41
41
  end
42
42
 
43
43
  def test_enable_logging
44
44
  @context.logging = false
45
45
  assert_not_predicate(@context, :logging?)
46
- execute("# enable-logging")
46
+ execute("\#@enable-logging")
47
47
  assert_predicate(@context, :logging?)
48
48
  end
49
49
 
50
50
  def test_suggest_create_dataset
51
51
  mock(@executor).execute_suggest_create_dataset("shop")
52
- execute("# suggest-create-dataset shop")
52
+ execute("\#@suggest-create-dataset shop")
53
+ end
54
+
55
+ def test_enable_ignore_feature_on_error
56
+ assert_not_equal(:omit, @context.on_error)
57
+ execute("\#@on-error omit")
58
+ assert_equal(:omit, @context.on_error)
53
59
  end
54
60
  end
55
61
 
@@ -107,9 +113,13 @@ class TestExecutor < Test::Unit::TestCase
107
113
  EOF
108
114
  command = "#{load_command}\n#{load_values}"
109
115
  actual_url = convert(command)
116
+
117
+ load_values_without_columns =
118
+ '[["groonga","http://groonga.org/"],["razil","http://razil.jp/"]]'
110
119
  arguments = {
111
120
  "table" => "Sites",
112
- "values" => load_values
121
+ "columns" => "_key,uri",
122
+ "values" => load_values_without_columns
113
123
  }
114
124
  expected_url = build_url("load", arguments)
115
125
 
@@ -128,7 +138,7 @@ EOF
128
138
 
129
139
  arguments = {
130
140
  "table" => "Sites",
131
- "values" => load_values
141
+ "values" => '[{"_key":"ruby","uri":"http://ruby-lang.org/"}]'
132
142
  }
133
143
  expected_url = build_url("load", arguments)
134
144
 
@@ -180,7 +190,11 @@ EOF
180
190
  def build_url(command, named_arguments)
181
191
  url = "/d/#{command}"
182
192
  query_parameters = []
183
- named_arguments.each do |name, argument|
193
+
194
+ sorted_arguments = named_arguments.sort_by do |name, _|
195
+ name
196
+ end
197
+ sorted_arguments.each do |name, argument|
184
198
  query_parameters << "#{CGI.escape(name)}=#{CGI.escape(argument)}"
185
199
  end
186
200
  unless query_parameters.empty?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-15 00:00:00.000000000 Z
13
+ date: 2012-12-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -44,6 +44,22 @@ dependencies:
44
44
  - - ! '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: groonga-command
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
47
63
  - !ruby/object:Gem::Dependency
48
64
  name: bundler
49
65
  requirement: !ruby/object:Gem::Requirement
@@ -92,6 +108,22 @@ dependencies:
92
108
  - - ! '>='
93
109
  - !ruby/object:Gem::Version
94
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: test-unit-rr
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
95
127
  - !ruby/object:Gem::Dependency
96
128
  name: packnga
97
129
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +169,7 @@ files:
137
169
  - Rakefile
138
170
  - Gemfile
139
171
  - grntest.gemspec
172
+ - .yardopts
140
173
  - lib/grntest/tester.rb
141
174
  - lib/grntest/version.rb
142
175
  - doc/text/news.md
@@ -157,12 +190,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
190
  - - ! '>='
158
191
  - !ruby/object:Gem::Version
159
192
  version: '0'
193
+ segments:
194
+ - 0
195
+ hash: -173336567552475669
160
196
  required_rubygems_version: !ruby/object:Gem::Requirement
161
197
  none: false
162
198
  requirements:
163
199
  - - ! '>='
164
200
  - !ruby/object:Gem::Version
165
201
  version: '0'
202
+ segments:
203
+ - 0
204
+ hash: -173336567552475669
166
205
  requirements: []
167
206
  rubyforge_project:
168
207
  rubygems_version: 1.8.23