testrocket 1.0.0 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc8e7c8a771afae93f8ada5b324550864bc2bd1f8412a54a7098f440abee3791
4
- data.tar.gz: 77dc8625ffc92a8c67fa23416be68b76d8a64516306d4f6e720d9da49f1941c2
3
+ metadata.gz: 06ada1739ceaafbbbf088207e2c957d12c20272b8d50a99fe7964a868401828b
4
+ data.tar.gz: 1229f23c0d064b3e093d2a8e6fca8c784f277d43a990bf67e32eb1f400f27d3c
5
5
  SHA512:
6
- metadata.gz: aeb2b9ca986a41655129ad22ff7bd8368da5ddf52bbb0cf92ebd60398910e8cf3257b2ac77f6384e11052a53fe50787b687f4813ec788b952239abfb9da0fc53
7
- data.tar.gz: 46400342d55f2bcee7d6be7d5ead3c540607cc372ea7608290e82fa624aaa957a329136b860aa16a9a867f47602e2a958c04ae4239610b252fce7d7632b4b479
6
+ metadata.gz: c9ceb9459b8657f3362b34976282bd1277b7a2ac4a3e11c28c80447ff261be9b07ec4e665d73c71803092ad32bfb6700211c564ff8d6419f07d0075d86b5779a
7
+ data.tar.gz: baffd75f9460dd548ae919d6d5c8ef4b83b7b22ff3cba90b8cfbcc454594639f598faf14e39ec17f447faad67be47bf237251f9ee9061c74777dca02f565f403
data/README.md CHANGED
@@ -4,9 +4,9 @@
4
4
  | |_| __|__ \ |_| | | (_) | (__| <| __/ |_
5
5
  \__|\___|___/\__|_| \___/ \___|_|\_\\___|\__|
6
6
 
7
- Testrocket is a super simple (as simple as it gets really) testing library for Ruby 2.0 and higher.
7
+ Testrocket is a super simple (as simple as it gets really) testing library for Ruby 2.0 and higher. It has also been modernized and tested to run on Ruby 3.4.
8
8
 
9
- It was initially developed for [a CodeBrawl contest](http://codebrawl.com/articles/contest-rundown-ruby-testing-libraries) and it won! People asked me to release it 'for real' so here we are.
9
+ It was initially developed for [a CodeBrawl contest](https://web.archive.org/web/20110725022042/http://codebrawl.com/articles/contest-rundown-ruby-testing-libraries) and it got first place! People asked me to release it 'for real' so here we are.
10
10
 
11
11
  To install:
12
12
 
@@ -14,14 +14,14 @@ To install:
14
14
 
15
15
  .. or add it to your `Gemfile` in the usual way.
16
16
 
17
- As yet there are no useful bits and pieces for creating test files (look at the example, it's easy!) or Rake tasks. But it's all crazy simple. A few things may be added later on.
17
+ As yet there are no useful bits and pieces for creating test files (look at the example, it's easy!) or Rake tasks.
18
18
 
19
19
  *Note: Prior to version 1, TestRocket extended built-in classes to work, but has (in 2019) been modernized to use refinements to avoid it clashing with third party libraries in real world scenarios (yes, people use this library in real world code!)*
20
20
 
21
21
  Dependencies
22
22
  ------------
23
23
 
24
- - Ruby 2.1 or higher
24
+ - Ruby 2.1 or higher (tested on Ruby 3.4)
25
25
  - minitest/spec (part of MRI 1.9+ standard library)
26
26
 
27
27
  Example
data/lib/testrocket.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  # TestRocket Module to refine lambdas an use them for lightweight tests
5
5
  #
6
6
  module TestRocket
7
- VERSION = '1.0.0'
7
+ VERSION = '1.1.0'
8
8
 
9
9
  extend Module.new { attr_accessor :out }
10
10
 
@@ -6,43 +6,43 @@ class RefinementTest
6
6
  def self.test!
7
7
  describe TestRocket do
8
8
  it 'should find emptiness non-truthful by default' do
9
- (+->{}).must_match(/FAIL/)
10
- (+->{}).must_match("#{__FILE__}:#{__LINE__}")
9
+ _(+->{}).must_match(/FAIL/)
10
+ _(+->{}).must_match("#{__FILE__}:#{__LINE__}")
11
11
  end
12
12
 
13
13
  it 'should pass a simple positive assertion' do
14
- (+->{ 2 + 2 == 4 }).must_match(/OK/)
14
+ _(+->{ 2 + 2 == 4 }).must_match(/OK/)
15
15
  end
16
16
 
17
17
  it 'should pass a simple negative assertion' do
18
- (-->{ 2 + 2 == 5 }).must_match(/OK/)
18
+ _(-->{ 2 + 2 == 5 }).must_match(/OK/)
19
19
  end
20
20
 
21
21
  it 'should fail a simple erroneous assertion' do
22
- (+->{ 2 + 2 == 5 }).must_match(/FAIL/)
23
- (+->{ 2 + 2 == 5 }).must_match("#{__FILE__}:#{__LINE__}")
22
+ _(+->{ 2 + 2 == 5 }).must_match(/FAIL/)
23
+ _(+->{ 2 + 2 == 5 }).must_match("#{__FILE__}:#{__LINE__}")
24
24
  end
25
25
 
26
26
  it 'should fail a simple correct assertion assumed to fail' do
27
- (-->{ 2 + 2 == 4 }).must_match(/FAIL/)
28
- (-->{ 2 + 2 == 4 }).must_match("#{__FILE__}:#{__LINE__}")
27
+ _(-->{ 2 + 2 == 4 }).must_match(/FAIL/)
28
+ _(-->{ 2 + 2 == 4 }).must_match("#{__FILE__}:#{__LINE__}")
29
29
  end
30
30
 
31
31
  it 'should give a pending notice' do
32
- (~->{ 'a pending test' }).must_match(/PENDING/)
33
- (~->{ 'a pending test' }).must_match(/a pending test/)
34
- (~->{ 'a pending test' }).must_match("#{__FILE__}:#{__LINE__}")
32
+ _(~->{ 'a pending test' }).must_match(/PENDING/)
33
+ _(~->{ 'a pending test' }).must_match(/a pending test/)
34
+ _(~->{ 'a pending test' }).must_match("#{__FILE__}:#{__LINE__}")
35
35
  end
36
36
 
37
37
  it 'should fire a description rocket' do
38
- (!->{ 'a description' }).must_match(/FIRE/)
39
- (!->{ 'a description' }).must_match(/a description/)
38
+ _(!->{ 'a description' }).must_match(/FIRE/)
39
+ _(!->{ 'a description' }).must_match(/a description/)
40
40
  end
41
41
 
42
42
  it 'would influence Ruby Proc if TestRocket used explitly' do
43
43
  (
44
44
  ok = ->() { nil }
45
- !ok
45
+ _(!ok)
46
46
  ).must_match(/FIRE/)
47
47
  end
48
48
  end
@@ -55,7 +55,7 @@ class NoRefinementTest
55
55
  it 'should not influence global Ruby scope and other libs' do
56
56
  (
57
57
  ok = ->() { nil }
58
- !ok
58
+ _(!ok)
59
59
  ).must_equal(false)
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testrocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Cooper
8
8
  - Christoph Grabo
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2019-10-02 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A super lightweight lamdba-based testing library for Ruby
15
14
  email:
@@ -32,7 +31,6 @@ files:
32
31
  homepage: http://github.com/peterc/testrocket
33
32
  licenses: []
34
33
  metadata: {}
35
- post_install_message:
36
34
  rdoc_options: []
37
35
  require_paths:
38
36
  - lib
@@ -47,9 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
45
  - !ruby/object:Gem::Version
48
46
  version: '0'
49
47
  requirements: []
50
- rubyforge_project: testrocket
51
- rubygems_version: 2.7.8
52
- signing_key:
48
+ rubygems_version: 3.6.7
53
49
  specification_version: 4
54
50
  summary: A super lightweight lamdba-based testing library for Ruby
55
51
  test_files: