minitest_should 0.1.0 → 0.1.1
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.
- data/README.md +5 -2
- data/lib/minitest/should/base.rb +1 -1
- data/lib/minitest/should/version.rb +1 -1
- data/test/test_minitest_should.rb +8 -0
- metadata +2 -2
data/README.md
CHANGED
|
@@ -39,9 +39,9 @@ As usual, just use the `gem install` command:
|
|
|
39
39
|
|
|
40
40
|
(sudo) gem install minitest_should
|
|
41
41
|
|
|
42
|
-
Or add
|
|
42
|
+
Or add minitest_should as a gem in your Gemfile:
|
|
43
43
|
|
|
44
|
-
gem 'minitest_should', '~> 0.1.
|
|
44
|
+
gem 'minitest_should', '~> 0.1.1'
|
|
45
45
|
|
|
46
46
|
Then run `bundle install`
|
|
47
47
|
|
|
@@ -58,6 +58,9 @@ Testing is done with minitest. Run the tests with:
|
|
|
58
58
|
Changelog
|
|
59
59
|
---------
|
|
60
60
|
|
|
61
|
+
**2011/11/8 - v0.1.1**
|
|
62
|
+
- ensure dynamic methods have save names
|
|
63
|
+
|
|
61
64
|
**2011/11/8 - v0.1.0**
|
|
62
65
|
- it exists!
|
|
63
66
|
|
data/lib/minitest/should/base.rb
CHANGED
|
@@ -9,7 +9,7 @@ module MiniTest
|
|
|
9
9
|
module ClassMethods
|
|
10
10
|
|
|
11
11
|
def should(name, &block)
|
|
12
|
-
method_name = [ "test_should_", name.downcase.gsub(
|
|
12
|
+
method_name = [ "test_should_", name.downcase.gsub(/[^a-z0-9\_\s]+/, ' ').strip.gsub(/\s+/, "_") ].join
|
|
13
13
|
if self.test_methods.include?(method_name)
|
|
14
14
|
raise MiniTest::Should::DuplicateMethodError, "Test named `#{method_name}` already exists in #{self.name}."
|
|
15
15
|
else
|
|
@@ -32,6 +32,14 @@ class TestMiniTestShould < MiniTest::Unit::TestCase
|
|
|
32
32
|
assert self.class.test_methods.include?("test_should_create_method_from_string")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
should "allow-crazy! @characters..." do
|
|
36
|
+
assert self.class.test_methods.include?("test_should_allow_crazy_characters")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
should "4 * 4 = 12" do #deadmau5
|
|
40
|
+
assert self.class.test_methods.include?("test_should_4_4_12")
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
should "work with multiple assertions" do
|
|
36
44
|
assert_block do
|
|
37
45
|
1 == 2 / 2
|
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: minitest_should
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 0.1.
|
|
5
|
+
version: 0.1.1
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Spencer Steffen
|
|
@@ -10,7 +10,7 @@ autorequire:
|
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
12
|
|
|
13
|
-
date: 2011-11-
|
|
13
|
+
date: 2011-11-09 00:00:00 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rake
|