README.md in assert-2.16.5 vs README.md in assert-2.17.0

- old
+ new

@@ -3,11 +3,11 @@ ## Usage ```ruby # in test/my_tests.rb -require 'assert' +require "assert" class MyTests < Assert::Context test "something" do assert_equal 1, 1 @@ -75,42 +75,42 @@ **Note**: Assert's stubbing logic has been extracted into a separate gem: [MuchStub](https://github.com/redding/much-stub/#muchstub). However, the main `Assert.{stub|unstub|stub_send|etc}` api is still available (it just proxies MuchStub now). ```ruby myclass = Class.new do - def mymeth; 'meth'; end + def mymeth; "meth"; end def myval(val); val; end end myobj = myclass.new myobj.mymeth - # => 'meth' + # => "meth" myobj.myval(123) # => 123 myobj.myval(456) # => 456 Assert.stub(myobj, :mymeth) myobj.mymeth # => StubError: `mymeth` not stubbed. -Assert.stub(myobj, :mymeth){ 'stub-meth' } +Assert.stub(myobj, :mymeth){ "stub-meth" } myobj.mymeth - # => 'stub-meth' + # => "stub-meth" myobj.mymeth(123) # => StubError: arity mismatch -Assert.stub(myobj, :mymeth).with(123){ 'stub-meth' } +Assert.stub(myobj, :mymeth).with(123){ "stub-meth" } # => StubError: arity mismatch Assert.stub_send(myobj, :mymeth) # call to the original method post-stub - # => 'meth' + # => "meth" -Assert.stub(myobj, :myval){ 'stub-meth' } +Assert.stub(myobj, :myval){ "stub-meth" } # => StubError: arity mismatch Assert.stub(myobj, :myval).with(123){ |val| val.to_s } myobj.myval # => StubError: arity mismatch myobj.myval(123) - # => '123' + # => "123" myobj.myval(456) # => StubError: `myval(456)` not stubbed. Assert.stub_send(myobj, :myval, 123) # call to the original method post-stub # => 123 Assert.stub_send(myobj, :myval, 456) @@ -118,21 +118,21 @@ Assert.unstub(myobj, :mymeth) Assert.unstub(myobj, :myval) myobj.mymeth - # => 'meth' + # => "meth" myobj.myval(123) # => 123 myobj.myval(456) # => 456 ``` ## Factory ```ruby -require 'assert/factory' +require "assert/factory" Assert::Factory.integer #=> 15742 Assert::Factory.integer(3) #=> 2 Assert::Factory.float #=> 87.2716908041922 Assert::Factory.float(3) #=> 2.5466638138805 @@ -195,11 +195,11 @@ | - complex | | - fast_tests.rb | | - slow_tests.rb ``` -* `$ assert` - runs all tests ('./test' is used if no paths are given) +* `$ assert` - runs all tests ("./test" is used if no paths are given) * `$ assert test/basic` - run all tests in basic_tests.rb * `$ assert test/complex/fast_tests.rb` - runs all tests in fast_tests.rb * `$ assert test/basic test/comp` - runs all tests in basic_tests.rb, complex_tests.rb, fast_tests.rb and slow_tests.rb All you need to do is pass some sort of existing file path (use tab-completion!) and Assert will find any test files and run the tests in them. @@ -235,11 +235,11 @@ ## Running Tests 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: ```ruby -require 'my_awesome_runner_class' +require "my_awesome_runner_class" Assert.configure do |config| config.runner MyAwesomeRunnerClass.new end ``` @@ -324,11 +324,11 @@ $ assert [-v|--verbose|--no-verbose] ``` ### Capture Output -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: +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: In user/local settings file: ```ruby Assert.configure do |config| @@ -402,11 +402,11 @@ This, of course, assumes you are working in a git repository. If you are not or you want to use custom logic to determine the changed files, configure a custom proc. The proc should take two parameters: the config and an array of test paths specified by the CLI. ```ruby Assert.configure do |config| config.changed_proc Proc.new do |config, test_paths| - `git diff --name-only master -- #{test_paths.join(' ')}`.split("\n") # or whatever + `git diff --name-only master -- #{test_paths.join(" ")}`.split("\n") # or whatever end end ``` If you just want to disable this feature completely: @@ -569,19 +569,19 @@ ### Using 3rd party views 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. ```ruby -Assert::View.require_user_view '/path/to/my/view' +Assert::View.require_user_view "/path/to/my/view" ``` 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: ```ruby # assuming ~/.assert/views/my-custom-view/lib/my-custom-view.rb exists # this will require it in -Assert::View.require_user_view 'my-custom-view' +Assert::View.require_user_view "my-custom-view" ``` Once your view class is required in, use it and configure it just as you would any view. ## Assert Models @@ -590,11 +590,11 @@ A `Suite` object is reponsible for collecting and structuring tests and defines the set of tests to run using the test `Runner`. Tests are grouped within the suite by their context. Suite provides access to the contexts, tests, and test results. In addition, the Suite model provides some stats (ie. run_time, runner_seed, etc...). ### Runner -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. +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. ### Context A `Context` object is the scope that tests are run in. When tests are run, a new instance of the test context is created and the test code is evaluated within the scope of this context instance. Context provides methods for defining tests and test callbacks and for generating test results in running tests. Subclass context classes to achieve nested context behavior. @@ -618,11 +618,11 @@ A `View` object is responsible for rendering test result output. Assert provides a `Assert::View` object to provide common helpers and default runner callback handlers for building views. Assert also provides an `Assert::DefaultView` that it renders its output with. See the "Viewing Test Results" section below for more details. ### Macro -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. +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. ## Installation ``` $ gem install assert @@ -634,10 +634,10 @@ If submitting a Pull Request, please: 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Added some feature'`) +3. Commit your changes (`git commit -am "Added some feature"`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request One note: please respect that Assert itself is intended to be the flexible, base-level, framework-type logic that should change little if at all. Pull requests for niche functionality or personal testing philosphy stuff will likely not be accepted.