minitest 5.6.0 → 5.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a1532fd0d9c25161ae3d4cae3357c707315d4d2
4
- data.tar.gz: 827d205c0a4e09b33a5ec0db933ed7d0a024e718
3
+ metadata.gz: 643d87aa2fc43e0e389936f3b368a70cd8b53dc2
4
+ data.tar.gz: 4bf639173401beb1fee19032489c9b3cd0eda5e8
5
5
  SHA512:
6
- metadata.gz: 1fbb8e6fef5e909de09ed424a977ee7a1d4cb9510213b1dbdce103ce28ef6b213024379e8ffedf42fd423f90464d07f6eeb50bc8c978e3131dc34b02a26a3f42
7
- data.tar.gz: 7e1c4342ce4313b98020f7f715d344bc222b8ee40b65d0ee3e9213e89f7b76c39ba268022579a34656da2b2a4dffe1fcfc2ef5e765d02fc521cb7b7a10305948
6
+ metadata.gz: eebdf97e22edea68677e72aca0d769ce32e6e0538db8de983ff7c9f31ed398c5ea8530606df6f041456d8da52373ea1d05d522e06d4577bc77569a0ba11bb3bf
7
+ data.tar.gz: 1f813b6fd7afa6c0aec914a8851da11613de6abbf1f5c8171e67e17d21f1033028ac766f4950b265265a3a1bd533d7329e6b5753f8c73a76b32025264f2999dc
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 5.6.1 / 2015-04-27
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Added Minitest.clock_time and switched all Time.now to it. (tenderlove)
6
+ * Moved Minitest::Expectations#_ into Minitest::Spec::DSL.
7
+
1
8
  === 5.6.0 / 2015-04-13
2
9
 
3
10
  * 4 major enhancements:
@@ -449,6 +449,10 @@ minispec-metadata :: Metadata for describe/it blocks & CLI tag filter.
449
449
  minitest-ansi :: Colorize minitest output with ANSI colors.
450
450
  minitest-around :: Around block for minitest. An alternative to
451
451
  setup/teardown dance.
452
+ minitest-autotest :: autotest is a continous testing facility meant to
453
+ be used during development.
454
+ minitest-bacon :: minitest-bacon extends minitest with bacon-like
455
+ functionality.
452
456
  minitest-bang :: Adds support for RSpec-style let! to immediately
453
457
  invoke let statements before each test.
454
458
  minitest-bisect :: Helps you isolate and debug random test failures.
@@ -475,9 +479,14 @@ minitest-english :: Semantically symmetric aliases for assertions and
475
479
  expectations.
476
480
  minitest-excludes :: Clean API for excluding certain tests you
477
481
  don't want to run under certain conditions.
482
+ minitest-filecontent :: Support unit tests with expectation results in files.
483
+ Differing results will be stored again in files.
478
484
  minitest-filesystem :: Adds assertion and expectation to help testing
479
485
  filesystem contents.
480
486
  minitest-firemock :: Makes your Minitest mocks more resilient.
487
+ minitest-focus :: Focus on one test at a time.
488
+ minitest-gcstats :: A minitest plugin that adds a report of the top
489
+ tests by number of objects allocated.
481
490
  minitest-great_expectations :: Generally useful additions to minitest's
482
491
  assertions and expectations.
483
492
  minitest-growl :: Test notifier for minitest via growl.
@@ -487,8 +496,11 @@ minitest-instrument :: Instrument ActiveSupport::Notifications when
487
496
  test method is executed.
488
497
  minitest-instrument-db :: Store information about speed of test execution
489
498
  provided by minitest-instrument in database.
499
+ minitest-junit :: JUnit-style XML reporter for minitest.
490
500
  minitest-libnotify :: Test notifier for minitest via libnotify.
491
501
  minitest-line :: Run test at line number.
502
+ minitest-logger :: Define assert_log and enable minitest to test log messages.
503
+ Supports Logger and Log4r::Logger.
492
504
  minitest-macruby :: Provides extensions to minitest for macruby UI
493
505
  testing.
494
506
  minitest-matchers :: Adds support for RSpec-style matchers to
@@ -509,6 +521,9 @@ minitest-rails-capybara :: Capybara integration for Minitest::Rails.
509
521
  minitest-reporters :: Create customizable Minitest output formats.
510
522
  minitest-rg :: Colored red/green output for Minitest.
511
523
  minitest-rspec_mocks :: Use RSpec Mocks with Minitest.
524
+ minitest-server :: minitest-server provides a client/server setup
525
+ with your minitest process, allowing your test
526
+ run to send its results directly to a handler.
512
527
  minitest-should_syntax :: RSpec-style +x.should == y+ assertions for
513
528
  Minitest.
514
529
  minitest-shouldify :: Adding all manner of shoulds to Minitest (bad
@@ -521,11 +536,15 @@ minitest-spec-expect :: Expect syntax for Minitest::Spec (e.g.
521
536
  minitest-spec-magic :: Minitest::Spec extensions for Rails and beyond.
522
537
  minitest-spec-rails :: Drop in Minitest::Spec superclass for
523
538
  ActiveSupport::TestCase.
539
+ minitest-sprint :: Runs (Get it? It's fast!) your tests and makes
540
+ it easier to rerun individual failures.
524
541
  minitest-stately :: Find leaking state between tests
525
542
  minitest-stub_any_instance :: Stub any instance of a method on the given class
526
543
  for the duration of a block.
527
544
  minitest-stub-const :: Stub constants for the duration of a block.
528
545
  minitest-tags :: Add tags for minitest.
546
+ minitest-unordered :: Adds a new assertion to minitest for checking the
547
+ contents of a collection, ignoring element order.
529
548
  minitest-vcr :: Automatic cassette managment with Minitest::Spec
530
549
  and VCR.
531
550
  minitest-wscolor :: Yet another test colorizer.
@@ -7,7 +7,7 @@ require "minitest/parallel"
7
7
  # :include: README.rdoc
8
8
 
9
9
  module Minitest
10
- VERSION = "5.6.0" # :nodoc:
10
+ VERSION = "5.6.1" # :nodoc:
11
11
  ENCS = "".respond_to? :encoding # :nodoc:
12
12
 
13
13
  @@installed_at_exit ||= false
@@ -507,7 +507,7 @@ module Minitest
507
507
  end
508
508
 
509
509
  def start # :nodoc:
510
- self.start_time = Time.now
510
+ self.start_time = Minitest.clock_time
511
511
  end
512
512
 
513
513
  def record result # :nodoc:
@@ -521,7 +521,7 @@ module Minitest
521
521
  aggregate = results.group_by { |r| r.failure.class }
522
522
  aggregate.default = [] # dumb. group_by should provide this
523
523
 
524
- self.total_time = Time.now - start_time
524
+ self.total_time = Minitest.clock_time - start_time
525
525
  self.failures = aggregate[Assertion].size
526
526
  self.errors = aggregate[UnexpectedError].size
527
527
  self.skips = aggregate[Skip].size
@@ -780,6 +780,16 @@ module Minitest
780
780
  raise "#{klass}#run _must_ return self" unless klass === result
781
781
  result
782
782
  end
783
+
784
+ if defined? Process::CLOCK_MONOTONIC
785
+ def self.clock_time
786
+ Process.clock_gettime Process::CLOCK_MONOTONIC
787
+ end
788
+ else
789
+ def self.clock_time
790
+ Time.now
791
+ end
792
+ end
783
793
  end
784
794
 
785
795
  require "minitest/test"
@@ -90,9 +90,9 @@ module Minitest
90
90
 
91
91
  range.each do |x|
92
92
  GC.start
93
- t0 = Time.now
93
+ t0 = Minitest.clock_time
94
94
  instance_exec(x, &work)
95
- t = Time.now - t0
95
+ t = Minitest.clock_time - t0
96
96
 
97
97
  io.print "\t%9.6f" % t
98
98
  times << t
@@ -18,30 +18,6 @@
18
18
 
19
19
  module Minitest::Expectations
20
20
 
21
- ##
22
- # Returns a value monad that has all of Expectations methods
23
- # available to it.
24
- #
25
- # Also aliased to #value and #expect for your aesthetic pleasure:
26
- #
27
- # _(1 + 1).must_equal 2
28
- # value(1 + 1).must_equal 2
29
- # expect(1 + 1).must_equal 2
30
- #
31
- # This method of expectation-based testing is preferable to
32
- # straight-expectation methods (on Object) because it stores its
33
- # test context, bypassing our hacky use of thread-local variables.
34
- #
35
- # At some point, the methods on Object will be deprecated and then
36
- # removed.
37
-
38
- def _ value = nil, &block
39
- Minitest::Expectation.new block || value, self
40
- end
41
-
42
- alias value _
43
- alias expect _
44
-
45
21
  ##
46
22
  # See Minitest::Assertions#assert_empty.
47
23
  #
@@ -277,7 +277,34 @@ class Minitest::Spec < Minitest::Test
277
277
  attr_reader :desc # :nodoc:
278
278
  alias :specify :it
279
279
 
280
- module InstanceMethods # :nodoc:
280
+ ##
281
+ # Rdoc... why are you so dumb?
282
+
283
+ module InstanceMethods
284
+ ##
285
+ # Returns a value monad that has all of Expectations methods
286
+ # available to it.
287
+ #
288
+ # Also aliased to #value and #expect for your aesthetic pleasure:
289
+ #
290
+ # _(1 + 1).must_equal 2
291
+ # value(1 + 1).must_equal 2
292
+ # expect(1 + 1).must_equal 2
293
+ #
294
+ # This method of expectation-based testing is preferable to
295
+ # straight-expectation methods (on Object) because it stores its
296
+ # test context, bypassing our hacky use of thread-local variables.
297
+ #
298
+ # At some point, the methods on Object will be deprecated and then
299
+ # removed.
300
+
301
+ def _ value = nil, &block
302
+ Minitest::Expectation.new block || value, self
303
+ end
304
+
305
+ alias value _
306
+ alias expect _
307
+
281
308
  def before_setup # :nodoc:
282
309
  super
283
310
  Thread.current[:current_spec] = self
@@ -251,11 +251,11 @@ module Minitest
251
251
  end
252
252
 
253
253
  def time_it # :nodoc:
254
- t0 = Time.now
254
+ t0 = Minitest.clock_time
255
255
 
256
256
  yield
257
257
  ensure
258
- self.time = Time.now - t0
258
+ self.time = Minitest.clock_time - t0
259
259
  end
260
260
 
261
261
  def to_s # :nodoc:
@@ -267,10 +267,10 @@ module Minitest
267
267
  end
268
268
 
269
269
  def with_info_handler &block # :nodoc:
270
- t0 = Time.now
270
+ t0 = Minitest.clock_time
271
271
 
272
272
  handler = lambda do
273
- warn "\nCurrent: %s#%s %.2fs" % [self.class, self.name, Time.now - t0]
273
+ warn "\nCurrent: %s#%s %.2fs" % [self.class, self.name, Minitest.clock_time - t0]
274
274
  end
275
275
 
276
276
  self.class.on_signal "INFO", handler, &block
@@ -912,3 +912,26 @@ class TestSpecInTestCase < MetaMetaMetaTestCase
912
912
  end
913
913
  end
914
914
  end
915
+
916
+ class ValueMonadTest < Minitest::Test
917
+ attr_accessor :struct
918
+
919
+ def setup
920
+ @struct = { :_ => 'a', :value => 'b', :expect => 'c' }
921
+ def @struct.method_missing k # think openstruct
922
+ self[k]
923
+ end
924
+ end
925
+
926
+ def test_value_monad_method
927
+ assert_equal 'a', struct._
928
+ end
929
+
930
+ def test_value_monad_value_alias
931
+ assert_equal 'b', struct.value
932
+ end
933
+
934
+ def test_value_monad_expect_alias
935
+ assert_equal 'c', struct.expect
936
+ end
937
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.0
4
+ version: 5.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -29,7 +29,7 @@ cert_chain:
29
29
  xJcC6UN6NHMOVMyAXsr2HR0gRRx4ofN1LoP2KhXzSr8UMvQYlwPmE0N5GQv1b5AO
30
30
  VpzF30vNaJK6ZT7xlIsIlwmH
31
31
  -----END CERTIFICATE-----
32
- date: 2015-04-13 00:00:00.000000000 Z
32
+ date: 2015-04-27 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rdoc
metadata.gz.sig CHANGED
Binary file