mini_shoulda 0.2.0 → 0.3.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.
- data/Gemfile +1 -1
- data/lib/mini_shoulda.rb +0 -1
- data/lib/mini_shoulda/version.rb +1 -1
- data/mini_shoulda.gemspec +1 -1
- data/test/scope_test.rb +13 -3
- metadata +3 -4
- data/lib/mini_shoulda/minitest_describe_patch.rb +0 -21
data/Gemfile
CHANGED
data/lib/mini_shoulda.rb
CHANGED
data/lib/mini_shoulda/version.rb
CHANGED
data/mini_shoulda.gemspec
CHANGED
@@ -15,5 +15,5 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ['lib']
|
18
|
-
s.add_dependency('minitest', '~> 2.0
|
18
|
+
s.add_dependency('minitest', '~> 2.1.0')
|
19
19
|
end
|
data/test/scope_test.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
# TODO: This test should disappear when we no longer have to patch MiniTest's
|
4
|
-
# Kernel#describe block using our 'mini_shoulda/minitest_describe_patch' file.
|
5
|
-
|
6
3
|
class ScopeTest < MiniShoulda::SpecCase
|
7
4
|
|
8
5
|
should 'use base instance helpers' do
|
@@ -29,3 +26,16 @@ class ScopeTest < MiniShoulda::SpecCase
|
|
29
26
|
|
30
27
|
|
31
28
|
end
|
29
|
+
|
30
|
+
class DuppedScopeTest < MiniTest::Spec
|
31
|
+
|
32
|
+
context('Context A') { }
|
33
|
+
|
34
|
+
context('Context B') { }
|
35
|
+
|
36
|
+
should 'only show this failure once' do
|
37
|
+
flunk "Passed if you only see this once!!!\n" +
|
38
|
+
"test_0001_only_show_this_failure_once(DuppedScopeTest)"
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: mini_shoulda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.3.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ken Collins
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-04-13 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
requirements:
|
22
22
|
- - ~>
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: 2.0
|
24
|
+
version: 2.1.0
|
25
25
|
type: :runtime
|
26
26
|
version_requirements: *id001
|
27
27
|
description: MiniShoulda - A minimal shoulda DSL built on top of MiniTest::Spec.
|
@@ -41,7 +41,6 @@ files:
|
|
41
41
|
- README.rdoc
|
42
42
|
- Rakefile
|
43
43
|
- lib/mini_shoulda.rb
|
44
|
-
- lib/mini_shoulda/minitest_describe_patch.rb
|
45
44
|
- lib/mini_shoulda/spec.rb
|
46
45
|
- lib/mini_shoulda/version.rb
|
47
46
|
- mini_shoulda.gemspec
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# I currently have a patch submitted to minitest to allow parent classes to maintain their
|
2
|
-
# inhertance chain when describe blocks are used. Please help me get it into core!
|
3
|
-
# https://github.com/seattlerb/minitest/pull/9
|
4
|
-
|
5
|
-
module Kernel
|
6
|
-
|
7
|
-
def describe desc, &block
|
8
|
-
stack = MiniTest::Spec.describe_stack
|
9
|
-
name = [stack.last, desc].compact.join("::")
|
10
|
-
sclas = stack.last || (self.is_a?(Class) && self < MiniTest::Spec ? self : MiniTest::Spec)
|
11
|
-
cls = Class.new(sclas)
|
12
|
-
(class << cls; self; end).send(:define_method, :to_s) { name }
|
13
|
-
cls.nuke_test_methods!
|
14
|
-
stack.push cls
|
15
|
-
cls.class_eval(&block)
|
16
|
-
stack.pop
|
17
|
-
cls
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|