minitest-sugar 1.0.1 → 2.0.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
  SHA1:
3
- metadata.gz: 24fd278b77acd09b7711231beede0dfef85c5e55
4
- data.tar.gz: 2b577f8eccfe77cad17bfdb5b66cf72e0e2f98fe
3
+ metadata.gz: c4c6e618f1321602f212a6a74d42590649dd9db1
4
+ data.tar.gz: 04ccac75a393d971061a94f1d74ce47d49d65d73
5
5
  SHA512:
6
- metadata.gz: 742eb57d1640c93252cc8b05b93ab89ae069939d8f6a494cbfb417f0fc47658ad999abeb6d8505741c35998a5fa438dfc6dd87e7cb7766389644d7c70dc441a3
7
- data.tar.gz: adc277915c7d430a0bec7e24a12d2be90e4024091dc0b3a51af27715fa2b1493e8c50018fdb7593df9dbab9d3d9492833a1adbc09183f44e8f627862ef9e793d
6
+ metadata.gz: d6be56a1135d391e998dbd5253dd496415bd37dfbf8045ee735090899919539a6b005bed12cd722d1955ff37134544230ca5f570a9955101c31a2012006513e8
7
+ data.tar.gz: 58454a1ae48311ba97d9df9547d694d57065bb77bef887c5d6fba54d004f55d19a1723e2dc39b3ae7a8901817480e997b3413a6288b817159518245571d7049e
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2012-2015 Francesco Rodríguez and contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,25 +1,26 @@
1
1
  minitest-sugar
2
2
  ==============
3
3
 
4
- Creates tests in a more human readable way.
5
-
6
- Installation
7
- ------------
8
-
9
- $ gem install minitest-sugar
4
+ Define a Minitest 5+ test using a String.
10
5
 
11
6
  Usage
12
7
  -----
13
8
 
14
9
  ```ruby
10
+ require "minitest/autorun"
15
11
  require "minitest/sugar"
16
12
 
17
13
  class TruthTest < Minitest::Test
18
- extend Minitest::Sugar
19
-
20
14
  # instead of `def test_assert_the_truth` do:
21
15
  test "assert the truth" do
22
16
  assert true
23
17
  end
24
18
  end
25
19
  ```
20
+
21
+ Installation
22
+ ------------
23
+
24
+ ```
25
+ $ gem install minitest-sugar
26
+ ```
@@ -1,26 +1,28 @@
1
1
  module Minitest
2
2
  module Sugar
3
- # Allow to create tests in a more human readable form.
3
+ # Public: Helper to define a test method using a String.
4
4
  #
5
- # class TruthTest < Minitest::Test
6
- # extend Minitest::Sugar
5
+ # Examples
6
+ #
7
+ # require "minitest/autorun"
8
+ # require "minitest/sugar"
9
+ #
10
+ # class TruthTest < Minitest::Test
11
+ # test "assert the truth" do
12
+ # assert true
13
+ # end
14
+ # end
7
15
  #
8
- # test "assert the truth" do
9
- # assert true
10
- # end
11
- # end
12
16
  def test(name, &block)
13
- test_name = "test_#{name.gsub(/\s+/,"_")}"
14
- defined = instance_method(test_name) rescue false
15
- raise "#{test_name} is already defined in #{self}" if defined
17
+ test_name = sprintf("test_%s", name.gsub(/\s+/, "_"))
16
18
 
17
- if block_given?
18
- define_method(test_name, &block)
19
- else
20
- define_method(test_name) do
21
- flunk("No implementation provided for #{name}")
22
- end
19
+ if (instance_method(test_name) rescue false)
20
+ raise "#{ test_name } is already defined in #{ self }"
23
21
  end
22
+
23
+ define_method(test_name, &block)
24
24
  end
25
25
  end
26
+
27
+ Test.extend(Sugar)
26
28
  end
@@ -0,0 +1,5 @@
1
+ module Minitest
2
+ module Sugar
3
+ VERSION = "2.0.0"
4
+ end
5
+ end
@@ -1,17 +1,18 @@
1
- gem "minitest", ">= 5.0.0"
1
+ require "bundler/setup"
2
2
  require "minitest/autorun"
3
+ require "minitest/pride"
3
4
  require_relative "../lib/minitest/sugar"
4
5
 
5
6
  class MinitestSugarTest < Minitest::Test
6
- extend Minitest::Sugar
7
-
8
7
  test "defines a friendly human description" do
9
8
  assert true
10
9
  end
11
10
 
12
11
  test "raises if the name is already taken" do
13
- self.class.test("name") {}
12
+ self.class.test("name") { }
14
13
 
15
- assert_raises(RuntimeError) { self.class.test("name") {} }
14
+ assert_raises(RuntimeError) do
15
+ self.class.test("name") { }
16
+ end
16
17
  end
17
18
  end
metadata CHANGED
@@ -1,46 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Rodriguez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-20 00:00:00.000000000 Z
11
+ date: 2015-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0
27
- description: Enough sugar for your minitest diet.
28
- email:
29
- - frodsan@me.com
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Enough sugar for your minitest diet
42
+ email: frodsan@protonmail.ch
30
43
  executables: []
31
44
  extensions: []
32
45
  extra_rdoc_files: []
33
46
  files:
34
- - ".gems"
35
- - ".gitignore"
47
+ - LICENSE
36
48
  - README.md
37
- - UNLICENSE
38
49
  - lib/minitest/sugar.rb
39
- - minitest-sugar.gemspec
40
- - test/sugar.rb
50
+ - lib/minitest/sugar/version.rb
51
+ - test/all.rb
41
52
  homepage: https://github.com/frodsan/minitest-sugar
42
53
  licenses:
43
- - Unlicense
54
+ - MIT
44
55
  metadata: {}
45
56
  post_install_message:
46
57
  rdoc_options: []
@@ -58,8 +69,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
69
  version: '0'
59
70
  requirements: []
60
71
  rubyforge_project:
61
- rubygems_version: 2.2.0
72
+ rubygems_version: 2.5.0
62
73
  signing_key:
63
74
  specification_version: 4
64
- summary: Enough sugar for your minitest diet.
65
- test_files: []
75
+ summary: Helper to define a test method using a String
76
+ test_files:
77
+ - test/all.rb
data/.gems DELETED
@@ -1 +0,0 @@
1
- minitest -v 5.2.1
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- *.gem
data/UNLICENSE DELETED
@@ -1,24 +0,0 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <http://unlicense.org/>
@@ -1,14 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = "minitest-sugar"
3
- s.version = "1.0.1"
4
- s.summary = "Enough sugar for your minitest diet."
5
- s.description = s.summary
6
- s.authors = ["Francesco Rodriguez"]
7
- s.email = ["frodsan@me.com"]
8
- s.homepage = "https://github.com/frodsan/minitest-sugar"
9
- s.license = "Unlicense"
10
-
11
- s.files = `git ls-files`.split("\n")
12
-
13
- s.add_dependency "minitest", ">= 5.0.0"
14
- end