assert 2.16.5 → 2.17.0

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.
Files changed (72) hide show
  1. checksums.yaml +7 -7
  2. data/Gemfile +3 -1
  3. data/README.md +20 -20
  4. data/assert.gemspec +5 -3
  5. data/bin/assert +4 -4
  6. data/lib/assert.rb +8 -8
  7. data/lib/assert/assert_runner.rb +7 -7
  8. data/lib/assert/assertions.rb +5 -5
  9. data/lib/assert/cli.rb +35 -35
  10. data/lib/assert/config.rb +8 -8
  11. data/lib/assert/config_helpers.rb +6 -6
  12. data/lib/assert/context.rb +17 -17
  13. data/lib/assert/context/test_dsl.rb +5 -5
  14. data/lib/assert/context_info.rb +2 -2
  15. data/lib/assert/default_runner.rb +1 -1
  16. data/lib/assert/default_suite.rb +1 -1
  17. data/lib/assert/default_view.rb +8 -8
  18. data/lib/assert/factory.rb +1 -1
  19. data/lib/assert/macro.rb +1 -1
  20. data/lib/assert/macros/methods.rb +1 -1
  21. data/lib/assert/result.rb +17 -17
  22. data/lib/assert/runner.rb +12 -8
  23. data/lib/assert/stub.rb +1 -1
  24. data/lib/assert/suite.rb +3 -3
  25. data/lib/assert/test.rb +11 -11
  26. data/lib/assert/utils.rb +8 -8
  27. data/lib/assert/version.rb +1 -1
  28. data/lib/assert/view.rb +19 -19
  29. data/lib/assert/view_helpers.rb +6 -6
  30. data/test/helper.rb +2 -11
  31. data/test/support/factory.rb +6 -6
  32. data/test/system/stub_tests.rb +204 -204
  33. data/test/system/test_tests.rb +13 -13
  34. data/test/unit/assert_tests.rb +9 -9
  35. data/test/unit/assertions/assert_block_tests.rb +2 -2
  36. data/test/unit/assertions/assert_empty_tests.rb +6 -6
  37. data/test/unit/assertions/assert_equal_tests.rb +5 -5
  38. data/test/unit/assertions/assert_file_exists_tests.rb +6 -6
  39. data/test/unit/assertions/assert_includes_tests.rb +7 -7
  40. data/test/unit/assertions/assert_instance_of_tests.rb +5 -5
  41. data/test/unit/assertions/assert_kind_of_tests.rb +5 -5
  42. data/test/unit/assertions/assert_match_tests.rb +5 -5
  43. data/test/unit/assertions/assert_nil_tests.rb +5 -5
  44. data/test/unit/assertions/assert_raises_tests.rb +2 -2
  45. data/test/unit/assertions/assert_respond_to_tests.rb +5 -5
  46. data/test/unit/assertions/assert_same_tests.rb +13 -13
  47. data/test/unit/assertions/assert_true_false_tests.rb +7 -7
  48. data/test/unit/assertions_tests.rb +2 -2
  49. data/test/unit/config_helpers_tests.rb +5 -5
  50. data/test/unit/config_tests.rb +12 -12
  51. data/test/unit/context/setup_dsl_tests.rb +7 -7
  52. data/test/unit/context/subject_dsl_tests.rb +3 -3
  53. data/test/unit/context/suite_dsl_tests.rb +3 -3
  54. data/test/unit/context/test_dsl_tests.rb +8 -8
  55. data/test/unit/context_info_tests.rb +6 -6
  56. data/test/unit/context_tests.rb +16 -16
  57. data/test/unit/default_runner_tests.rb +3 -3
  58. data/test/unit/default_suite_tests.rb +3 -3
  59. data/test/unit/factory_tests.rb +3 -3
  60. data/test/unit/file_line_tests.rb +12 -12
  61. data/test/unit/macro_tests.rb +2 -2
  62. data/test/unit/result_tests.rb +18 -18
  63. data/test/unit/runner_tests.rb +9 -9
  64. data/test/unit/suite_tests.rb +5 -5
  65. data/test/unit/test_tests.rb +19 -19
  66. data/test/unit/utils_tests.rb +18 -18
  67. data/test/unit/view_helpers_tests.rb +15 -15
  68. data/test/unit/view_tests.rb +11 -11
  69. data/tmp/.gitkeep +0 -0
  70. metadata +46 -44
  71. data/.assert.rb +0 -3
  72. data/.gitignore +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- data.tar.gz: 624cea8dff7a65ada7c133ccf0ad93d8f70fb050
4
- metadata.gz: f60b216b9827bab390bb1be74d2161392a087489
5
- SHA512:
6
- data.tar.gz: 7dda4ee76847adaeb2b3044e186baa73c36c1f1f52c8575fa5afb73366636a86ef84381f9db39049e728881981add634206deb1fb9f1ba97932cecb0aa141f75
7
- metadata.gz: 13e4b4811041f08d2686edad2f41654f6d711fdb9ed7f6d2863f7a090397ec8b7e9f460cfb6d1aba55f04cfe149992b5a44d57744f98fda4c001bd6223e7dea5
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9f64c7aa2c506b0fcf989763e437a103dd5401213f88bce9b7f4e7712db7fbe0
4
+ data.tar.gz: 3f5c30459a2528888dc24e356e626939e1fd204e1d287f06bbedf909c2d7eee9
5
+ SHA512:
6
+ metadata.gz: 6e9f3644f6c86856e3fd5c13560ecd6f7cadf194b158ccb3526267476745de34ca8ac87968cc5bf5f8d08d690a8cea40547e2a4dace29607916c6b558403d3c9
7
+ data.tar.gz: 80eb01f4d6aa450203c6db05a33f48bc515dc8e9a71b8532cead71439dabb373455b6cfa78c718e96364a3d7562027c6dd878a2393bca50fc9a614825c2e7a8d
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ ruby '> 1.8'
4
+
3
5
  gemspec
4
6
 
5
- gem 'pry', "~> 0.9.0"
7
+ gem "pry", "~> 0.11.3"
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ```ruby
6
6
  # in test/my_tests.rb
7
7
 
8
- require 'assert'
8
+ require "assert"
9
9
 
10
10
  class MyTests < Assert::Context
11
11
 
@@ -77,13 +77,13 @@ Assert comes with a stubbing API - all it does is replace method calls. In gene
77
77
 
78
78
  ```ruby
79
79
  myclass = Class.new do
80
- def mymeth; 'meth'; end
80
+ def mymeth; "meth"; end
81
81
  def myval(val); val; end
82
82
  end
83
83
  myobj = myclass.new
84
84
 
85
85
  myobj.mymeth
86
- # => 'meth'
86
+ # => "meth"
87
87
  myobj.myval(123)
88
88
  # => 123
89
89
  myobj.myval(456)
@@ -92,23 +92,23 @@ myobj.myval(456)
92
92
  Assert.stub(myobj, :mymeth)
93
93
  myobj.mymeth
94
94
  # => StubError: `mymeth` not stubbed.
95
- Assert.stub(myobj, :mymeth){ 'stub-meth' }
95
+ Assert.stub(myobj, :mymeth){ "stub-meth" }
96
96
  myobj.mymeth
97
- # => 'stub-meth'
97
+ # => "stub-meth"
98
98
  myobj.mymeth(123)
99
99
  # => StubError: arity mismatch
100
- Assert.stub(myobj, :mymeth).with(123){ 'stub-meth' }
100
+ Assert.stub(myobj, :mymeth).with(123){ "stub-meth" }
101
101
  # => StubError: arity mismatch
102
102
  Assert.stub_send(myobj, :mymeth) # call to the original method post-stub
103
- # => 'meth'
103
+ # => "meth"
104
104
 
105
- Assert.stub(myobj, :myval){ 'stub-meth' }
105
+ Assert.stub(myobj, :myval){ "stub-meth" }
106
106
  # => StubError: arity mismatch
107
107
  Assert.stub(myobj, :myval).with(123){ |val| val.to_s }
108
108
  myobj.myval
109
109
  # => StubError: arity mismatch
110
110
  myobj.myval(123)
111
- # => '123'
111
+ # => "123"
112
112
  myobj.myval(456)
113
113
  # => StubError: `myval(456)` not stubbed.
114
114
  Assert.stub_send(myobj, :myval, 123) # call to the original method post-stub
@@ -120,7 +120,7 @@ Assert.unstub(myobj, :mymeth)
120
120
  Assert.unstub(myobj, :myval)
121
121
 
122
122
  myobj.mymeth
123
- # => 'meth'
123
+ # => "meth"
124
124
  myobj.myval(123)
125
125
  # => 123
126
126
  myobj.myval(456)
@@ -130,7 +130,7 @@ myobj.myval(456)
130
130
  ## Factory
131
131
 
132
132
  ```ruby
133
- require 'assert/factory'
133
+ require "assert/factory"
134
134
 
135
135
  Assert::Factory.integer #=> 15742
136
136
  Assert::Factory.integer(3) #=> 2
@@ -197,7 +197,7 @@ As an example, say your test folder has a file structure like so:
197
197
  | | - slow_tests.rb
198
198
  ```
199
199
 
200
- * `$ assert` - runs all tests ('./test' is used if no paths are given)
200
+ * `$ assert` - runs all tests ("./test" is used if no paths are given)
201
201
  * `$ assert test/basic` - run all tests in basic_tests.rb
202
202
  * `$ assert test/complex/fast_tests.rb` - runs all tests in fast_tests.rb
203
203
  * `$ assert test/basic test/comp` - runs all tests in basic_tests.rb, complex_tests.rb, fast_tests.rb and slow_tests.rb
@@ -237,7 +237,7 @@ Assert accepts options from its CLI. Use these options to specify absolute runt
237
237
  Assert uses its [`Assert::Runner`](/lib/assert/runner.rb) to run tests. You can extend this default runner or use your own runner implementation. Specify it in your user/local settings:
238
238
 
239
239
  ```ruby
240
- require 'my_awesome_runner_class'
240
+ require "my_awesome_runner_class"
241
241
 
242
242
  Assert.configure do |config|
243
243
  config.runner MyAwesomeRunnerClass.new
@@ -326,7 +326,7 @@ $ assert [-v|--verbose|--no-verbose]
326
326
 
327
327
  ### Capture Output
328
328
 
329
- By default, Assert shows any output on `$stdout` produced while running a test. It provides a setting to override whether to show this output or to 'capture' it and display it in the test result details:
329
+ By default, Assert shows any output on `$stdout` produced while running a test. It provides a setting to override whether to show this output or to "capture" it and display it in the test result details:
330
330
 
331
331
  In user/local settings file:
332
332
 
@@ -404,7 +404,7 @@ This, of course, assumes you are working in a git repository. If you are not or
404
404
  ```ruby
405
405
  Assert.configure do |config|
406
406
  config.changed_proc Proc.new do |config, test_paths|
407
- `git diff --name-only master -- #{test_paths.join(' ')}`.split("\n") # or whatever
407
+ `git diff --name-only master -- #{test_paths.join(" ")}`.split("\n") # or whatever
408
408
  end
409
409
  end
410
410
  ```
@@ -571,7 +571,7 @@ Beyond that, each view can do as it sees fit. Initialize how you wish, take wha
571
571
  To use a 3rd party custom view, first require it in and then configure it. Assert provides a helper for requiring in views. It can be used in two ways. You can pass a fully qualified path to the helper and if it exists, will require it in.
572
572
 
573
573
  ```ruby
574
- Assert::View.require_user_view '/path/to/my/view'
574
+ Assert::View.require_user_view "/path/to/my/view"
575
575
  ```
576
576
 
577
577
  Alternatively, you can install/clone/copy/write your view implementations in `~/.assert/views` and require it in by name. To have assert require it by name, have it installed at `~/assert/views/view_name/lib/view_name.rb` (this structure is compatible with popular conventions for rubygem development). For example:
@@ -579,7 +579,7 @@ Alternatively, you can install/clone/copy/write your view implementations in `~/
579
579
  ```ruby
580
580
  # assuming ~/.assert/views/my-custom-view/lib/my-custom-view.rb exists
581
581
  # this will require it in
582
- Assert::View.require_user_view 'my-custom-view'
582
+ Assert::View.require_user_view "my-custom-view"
583
583
  ```
584
584
 
585
585
  Once your view class is required in, use it and configure it just as you would any view.
@@ -592,7 +592,7 @@ A `Suite` object is reponsible for collecting and structuring tests and defines
592
592
 
593
593
  ### Runner
594
594
 
595
- A `Runner` object is responsible for running a suite of tests and firing event callbacks to the `View`. Any runner object should take the test suite and view as arguments and should provide a 'run' method that runs the tests and renders the view.
595
+ A `Runner` object is responsible for running a suite of tests and firing event callbacks to the `View`. Any runner object should take the test suite and view as arguments and should provide a "run" method that runs the tests and renders the view.
596
596
 
597
597
  ### Context
598
598
 
@@ -620,7 +620,7 @@ A `View` object is responsible for rendering test result output. Assert provide
620
620
 
621
621
  ### Macro
622
622
 
623
- Macros are procs that define sets of test code and make it available for easy reuse. Macros work nicely with the 'should' and 'test' context methods.
623
+ Macros are procs that define sets of test code and make it available for easy reuse. Macros work nicely with the "should" and "test" context methods.
624
624
 
625
625
  ## Installation
626
626
 
@@ -636,7 +636,7 @@ If submitting a Pull Request, please:
636
636
 
637
637
  1. Fork it
638
638
  2. Create your feature branch (`git checkout -b my-new-feature`)
639
- 3. Commit your changes (`git commit -am 'Added some feature'`)
639
+ 3. Commit your changes (`git commit -am "Added some feature"`)
640
640
  4. Push to the branch (`git push origin my-new-feature`)
641
641
  5. Create new Pull Request
642
642
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require "assert/version"
5
5
 
@@ -11,13 +11,15 @@ Gem::Specification.new do |gem|
11
11
  gem.summary = %q{Assertion style testing framework.}
12
12
  gem.description = %q{Assertion style testing framework.}
13
13
  gem.homepage = "http://github.com/redding/assert"
14
- gem.license = 'MIT'
14
+ gem.license = "MIT"
15
15
 
16
- gem.files = `git ls-files`.split($/)
16
+ gem.files = `git ls-files | grep "^[^.]"`.split($/)
17
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.require_paths = ["lib"]
20
20
 
21
+ gem.required_ruby_version = '> 1.8'
22
+
21
23
  gem.add_dependency("much-factory", ["~> 0.1.0"])
22
24
  gem.add_dependency("much-stub", ["~> 0.1.0"])
23
25
 
data/bin/assert CHANGED
@@ -3,10 +3,10 @@
3
3
  # Copyright (c) 2011-Present Kelly Redding and Collin Redding
4
4
  #
5
5
 
6
- require 'assert'
7
- require 'assert/cli'
6
+ require "assert"
7
+ require "assert/cli"
8
8
 
9
- Assert.config.debug ENV['ASSERT_DEBUG'] == 'true' || Assert::CLI.debug?(ARGV)
9
+ Assert.config.debug ENV["ASSERT_DEBUG"] == "true" || Assert::CLI.debug?(ARGV)
10
10
 
11
- Assert::CLI.bench('CLI init and parse'){ @cli = Assert::CLI.new(*ARGV) }
11
+ Assert::CLI.bench("CLI init and parse"){ @cli = Assert::CLI.new(*ARGV) }
12
12
  @cli.run
@@ -1,12 +1,12 @@
1
- require 'assert/version'
1
+ require "assert/version"
2
2
 
3
- require 'assert/config'
4
- require 'assert/context'
5
- require 'assert/runner'
6
- require 'assert/stub'
7
- require 'assert/suite'
8
- require 'assert/utils'
9
- require 'assert/view'
3
+ require "assert/config"
4
+ require "assert/context"
5
+ require "assert/runner"
6
+ require "assert/stub"
7
+ require "assert/suite"
8
+ require "assert/utils"
9
+ require "assert/view"
10
10
 
11
11
  module Assert
12
12
 
@@ -1,4 +1,4 @@
1
- require 'assert/cli'
1
+ require "assert/cli"
2
2
 
3
3
  module Assert
4
4
 
@@ -10,7 +10,7 @@ module Assert
10
10
 
11
11
  def initialize(config, test_paths, test_options)
12
12
  @config = config
13
- Assert::CLI.bench('Applying settings') do
13
+ Assert::CLI.bench("Applying settings") do
14
14
  apply_user_settings
15
15
  apply_local_settings
16
16
  apply_env_settings
@@ -25,7 +25,7 @@ module Assert
25
25
  def init(test_files, test_dir)
26
26
  # load any test helper file
27
27
  if test_dir && (h = File.join(test_dir, self.config.test_helper)) && File.exists?(h)
28
- Assert::CLI.bench('Requiring test helper'){ require h }
28
+ Assert::CLI.bench("Requiring test helper"){ require h }
29
29
  end
30
30
 
31
31
  if self.config.list
@@ -61,15 +61,15 @@ module Assert
61
61
  end
62
62
 
63
63
  def apply_user_settings
64
- safe_require("#{ENV['HOME']}/#{USER_SETTINGS_FILE}") if ENV['HOME']
64
+ safe_require("#{ENV["HOME"]}/#{USER_SETTINGS_FILE}") if ENV["HOME"]
65
65
  end
66
66
 
67
67
  def apply_local_settings
68
- safe_require(ENV['ASSERT_LOCALFILE'] || path_of(LOCAL_SETTINGS_FILE, Dir.pwd))
68
+ safe_require(ENV["ASSERT_LOCALFILE"] || path_of(LOCAL_SETTINGS_FILE, Dir.pwd))
69
69
  end
70
70
 
71
71
  def apply_env_settings
72
- self.config.runner_seed ENV['ASSERT_RUNNER_SEED'].to_i if ENV['ASSERT_RUNNER_SEED']
72
+ self.config.runner_seed ENV["ASSERT_RUNNER_SEED"].to_i if ENV["ASSERT_RUNNER_SEED"]
73
73
  end
74
74
 
75
75
  def apply_option_settings(options)
@@ -111,7 +111,7 @@ module Assert
111
111
 
112
112
  def path_of(segment, a_path)
113
113
  # this method inspects a test path and finds the test dir path.
114
- full_path = File.expand_path(a_path || '.', Dir.pwd)
114
+ full_path = File.expand_path(a_path || ".", Dir.pwd)
115
115
  seg_pos = full_path.index(segment_regex(segment))
116
116
  File.join(seg_pos && (seg_pos > 0) ? full_path[0..(seg_pos-1)] : full_path, segment)
117
117
  end
@@ -1,4 +1,4 @@
1
- require 'assert/utils'
1
+ require "assert/utils"
2
2
 
3
3
  module Assert
4
4
 
@@ -214,8 +214,8 @@ module Assert
214
214
  c = __assert_config__
215
215
  exp_show = Assert::U.show_for_diff(exp, c)
216
216
  act_show = Assert::U.show_for_diff(act, c)
217
- exp_id = "#<#{exp.class}:#{'0x0%x' % (exp.object_id << 1)}>"
218
- act_id = "#<#{act.class}:#{'0x0%x' % (act.object_id << 1)}>"
217
+ exp_id = "#<#{exp.class}:#{"0x0%x" % (exp.object_id << 1)}>"
218
+ act_id = "#<#{act.class}:#{"0x0%x" % (act.object_id << 1)}>"
219
219
 
220
220
  if c.use_diff_proc.call(exp_show, act_show)
221
221
  "Expected #{act_id} to be the same as #{exp_id}, diff:\n"\
@@ -232,8 +232,8 @@ module Assert
232
232
  c = __assert_config__
233
233
  exp_show = Assert::U.show_for_diff(exp, c)
234
234
  act_show = Assert::U.show_for_diff(act, c)
235
- exp_id = "#<#{exp.class}:#{'0x0%x' % (exp.object_id << 1)}>"
236
- act_id = "#<#{act.class}:#{'0x0%x' % (act.object_id << 1)}>"
235
+ exp_id = "#<#{exp.class}:#{"0x0%x" % (exp.object_id << 1)}>"
236
+ act_id = "#<#{act.class}:#{"0x0%x" % (act.object_id << 1)}>"
237
237
 
238
238
  if c.use_diff_proc.call(exp_show, act_show)
239
239
  "Expected #{act_id} to not be the same as #{exp_id}, diff:\n"\
@@ -1,14 +1,14 @@
1
- require 'benchmark'
2
- require 'set'
3
- require 'assert/assert_runner'
4
- require 'assert/version'
1
+ require "benchmark"
2
+ require "set"
3
+ require "assert/assert_runner"
4
+ require "assert/version"
5
5
 
6
6
  module Assert
7
7
 
8
8
  class CLI
9
9
 
10
10
  def self.debug?(args)
11
- args.include?('-d') || args.include?('--debug')
11
+ args.include?("-d") || args.include?("--debug")
12
12
  end
13
13
 
14
14
  def self.debug_msg(msg)
@@ -36,39 +36,39 @@ module Assert
36
36
  def initialize(*args)
37
37
  @args = args
38
38
  @cli = CLIRB.new do
39
- option 'runner_seed', 'use a given seed to run tests', {
40
- :abbrev => 's', :value => Fixnum
39
+ option "runner_seed", "use a given seed to run tests", {
40
+ :abbrev => "s", :value => Fixnum
41
41
  }
42
- option 'changed_only', 'only run test files with changes', {
43
- :abbrev => 'c'
42
+ option "changed_only", "only run test files with changes", {
43
+ :abbrev => "c"
44
44
  }
45
- option 'changed_ref', 'reference for changes, use with `-c` opt', {
46
- :abbrev => 'r', :value => ''
45
+ option "changed_ref", "reference for changes, use with `-c` opt", {
46
+ :abbrev => "r", :value => ""
47
47
  }
48
- option 'single_test', 'only run the test on the given file/line', {
49
- :abbrev => 't', :value => ''
48
+ option "single_test", "only run the test on the given file/line", {
49
+ :abbrev => "t", :value => ""
50
50
  }
51
- option 'pp_objects', 'pretty-print objects in fail messages', {
52
- :abbrev => 'p'
51
+ option "pp_objects", "pretty-print objects in fail messages", {
52
+ :abbrev => "p"
53
53
  }
54
- option 'capture_output', 'capture stdout and display in result details', {
55
- :abbrev => 'o'
54
+ option "capture_output", "capture stdout and display in result details", {
55
+ :abbrev => "o"
56
56
  }
57
- option 'halt_on_fail', 'halt a test when it fails', {
58
- :abbrev => 'h'
57
+ option "halt_on_fail", "halt a test when it fails", {
58
+ :abbrev => "h"
59
59
  }
60
- option 'profile', 'output test profile info', {
61
- :abbrev => 'e'
60
+ option "profile", "output test profile info", {
61
+ :abbrev => "e"
62
62
  }
63
- option 'verbose', 'output verbose runtime test info', {
64
- :abbrev => 'v'
63
+ option "verbose", "output verbose runtime test info", {
64
+ :abbrev => "v"
65
65
  }
66
- option 'list', 'list test files on $stdout', {
67
- :abbrev => 'l'
66
+ option "list", "list test files on $stdout", {
67
+ :abbrev => "l"
68
68
  }
69
69
  # show loaded test files, cli err backtraces, etc
70
- option 'debug', 'run in debug mode', {
71
- :abbrev => 'd'
70
+ option "debug", "run in debug mode", {
71
+ :abbrev => "d"
72
72
  }
73
73
  end
74
74
  end
@@ -118,13 +118,13 @@ module Assert
118
118
 
119
119
  def initialize(&block)
120
120
  @options = []; instance_eval(&block) if block
121
- require 'optparse'
121
+ require "optparse"
122
122
  @data, @args, @opts = [], [], {}; @parser = OptionParser.new do |p|
123
- p.banner = ''; @options.each do |o|
123
+ p.banner = ""; @options.each do |o|
124
124
  @opts[o.name] = o.value; p.on(*o.parser_args){ |v| @opts[o.name] = v }
125
125
  end
126
- p.on_tail('--version', ''){ |v| raise VersionExit, v.to_s }
127
- p.on_tail('--help', ''){ |v| raise HelpExit, v.to_s }
126
+ p.on_tail("--version", ""){ |v| raise VersionExit, v.to_s }
127
+ p.on_tail("--help", ""){ |v| raise HelpExit, v.to_s }
128
128
  end
129
129
  end
130
130
 
@@ -137,14 +137,14 @@ module Assert
137
137
  end
138
138
  def to_s; @parser.to_s; end
139
139
  def inspect
140
- "#<#{self.class}:#{'0x0%x' % (object_id << 1)} @data=#{@data.inspect}>"
140
+ "#<#{self.class}:#{"0x0%x" % (object_id << 1)} @data=#{@data.inspect}>"
141
141
  end
142
142
 
143
143
  class Option
144
144
  attr_reader :name, :opt_name, :desc, :abbrev, :value, :klass, :parser_args
145
145
 
146
146
  def initialize(name, *args)
147
- settings, @desc = args.last.kind_of?(::Hash) ? args.pop : {}, args.pop || ''
147
+ settings, @desc = args.last.kind_of?(::Hash) ? args.pop : {}, args.pop || ""
148
148
  @name, @opt_name, @abbrev = parse_name_values(name, settings[:abbrev])
149
149
  @value, @klass = gvalinfo(settings[:value])
150
150
  @parser_args = if [TrueClass, FalseClass, NilClass].include?(@klass)
@@ -157,8 +157,8 @@ module Assert
157
157
  private
158
158
 
159
159
  def parse_name_values(name, custom_abbrev)
160
- [ (processed_name = name.to_s.strip.downcase), processed_name.gsub('_', '-'),
161
- custom_abbrev || processed_name.gsub(/[^a-z]/, '').chars.first || 'a'
160
+ [ (processed_name = name.to_s.strip.downcase), processed_name.gsub("_", "-"),
161
+ custom_abbrev || processed_name.gsub(/[^a-z]/, "").chars.first || "a"
162
162
  ]
163
163
  end
164
164
  def gvalinfo(v); v.kind_of?(Class) ? [nil,gklass(v)] : [v,gklass(v.class)]; end
@@ -1,8 +1,8 @@
1
- require 'assert/default_runner'
2
- require 'assert/default_suite'
3
- require 'assert/default_view'
4
- require 'assert/file_line'
5
- require 'assert/utils'
1
+ require "assert/default_runner"
2
+ require "assert/default_suite"
3
+ require "assert/default_view"
4
+ require "assert/file_line"
5
+ require "assert/utils"
6
6
 
7
7
  module Assert
8
8
 
@@ -33,7 +33,7 @@ module Assert
33
33
 
34
34
  @test_dir = "test"
35
35
  @test_helper = "helper.rb"
36
- @test_file_suffixes = ['_tests.rb', '_test.rb']
36
+ @test_file_suffixes = ["_tests.rb", "_test.rb"]
37
37
 
38
38
  @changed_proc = Assert::U.git_changed_proc
39
39
  @pp_proc = Assert::U.stdlib_pp_proc
@@ -43,8 +43,8 @@ module Assert
43
43
  # option settings
44
44
  @runner_seed = begin; srand; srand % 0xFFFF; end.to_i
45
45
  @changed_only = false
46
- @changed_ref = ''
47
- @single_test = ''
46
+ @changed_ref = ""
47
+ @single_test = ""
48
48
  @pp_objects = false
49
49
  @capture_output = false
50
50
  @halt_on_fail = true