minitest-spec-rails 4.3.8 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,12 +1,15 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.3
4
- - ruby-head
4
+ - 2.0.0
5
5
  gemfile:
6
6
  - gemfiles/rails30.gemfile
7
7
  - gemfiles/rails31.gemfile
8
8
  - gemfiles/rails32.gemfile
9
9
  - gemfiles/rails40.gemfile
10
+ before_install:
11
+ - gem install bundler
12
+ - bundle --version
10
13
  matrix:
11
14
  exclude:
12
15
  - rvm: 1.8.7
data/Appraisals CHANGED
@@ -12,6 +12,6 @@ appraise 'rails32' do
12
12
  end
13
13
 
14
14
  appraise 'rails40' do
15
- gem 'rails', :github => 'rails/rails'
15
+ gem 'rails', '~> 4.0.0.beta'
16
16
  end
17
17
 
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ ## 4.7.0
3
+
4
+ * Use Minitest::Spec::DSL provided by Minitest 4.7.
5
+
6
+
2
7
  ## 4.3.8
3
8
 
4
9
  * Less coupling to ActiveRecord ORM, works for MongoDB now. Thanks @kimsuelim
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
data/Guardfile ADDED
@@ -0,0 +1,7 @@
1
+ guard 'minitest' do
2
+ watch(%r|^lib/minitest-spec-rails/init/(.*)\.rb|) { |m| "test/cases/#{m[1]}_test.rb" }
3
+ watch(%r|^test/test_helper\.rb|) { "test" }
4
+ watch(%r|^test/test_helper_dummy\.rb|) { "test" }
5
+ watch(%r|^test/cases/(.*)_test\.rb|)
6
+ watch(%r|^test/dummy_tests/(.*)_test\.rb|)
7
+ end
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source :rubygems
3
+ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 3.0.0"
6
6
 
@@ -2,11 +2,12 @@ PATH
2
2
  remote: /Users/kencollins/Repositories/minitest-spec-rails
3
3
  specs:
4
4
  minitest-spec-rails (4.3.8)
5
- minitest (~> 4.3)
5
+ minitest (~> 4.7)
6
+ minitest_tu_shim (~> 1.3.2)
6
7
  rails (>= 3.0)
7
8
 
8
9
  GEM
9
- remote: http://rubygems.org/
10
+ remote: https://rubygems.org/
10
11
  specs:
11
12
  abstract (1.0.0)
12
13
  actionmailer (3.0.20)
@@ -40,19 +41,39 @@ GEM
40
41
  rake
41
42
  arel (2.0.10)
42
43
  builder (2.1.2)
44
+ coderay (1.0.9)
43
45
  erubis (2.6.6)
44
46
  abstract (>= 1.0.0)
47
+ guard (1.6.2)
48
+ listen (>= 0.6.0)
49
+ lumberjack (>= 1.0.2)
50
+ pry (>= 0.9.10)
51
+ terminal-table (>= 1.4.3)
52
+ thor (>= 0.14.6)
53
+ guard-minitest (0.5.0)
54
+ guard (>= 0.4)
45
55
  i18n (0.5.0)
46
56
  json (1.7.7)
57
+ listen (0.7.3)
58
+ lumberjack (1.0.2)
47
59
  mail (2.2.19)
48
60
  activesupport (>= 2.3.6)
49
61
  i18n (>= 0.4.0)
50
62
  mime-types (~> 1.16)
51
63
  treetop (~> 1.4.8)
64
+ method_source (0.8.1)
52
65
  mime-types (1.21)
53
- minitest (4.6.0)
66
+ minitest (4.7.0)
54
67
  minitest-emoji (1.0.0)
68
+ minitest-focus (1.0.0)
69
+ minitest (~> 4.4)
70
+ minitest_tu_shim (1.3.2)
71
+ minitest (>= 1.6.0)
55
72
  polyglot (0.3.3)
73
+ pry (0.9.12)
74
+ coderay (~> 1.0.5)
75
+ method_source (~> 0.8)
76
+ slop (~> 3.4)
56
77
  rack (1.2.8)
57
78
  rack-mount (0.6.14)
58
79
  rack (>= 1.0.0)
@@ -73,21 +94,25 @@ GEM
73
94
  rdoc (~> 3.4)
74
95
  thor (~> 0.14.4)
75
96
  rake (10.0.3)
76
- rdoc (3.12.1)
97
+ rdoc (3.12.2)
77
98
  json (~> 1.4)
99
+ slop (3.4.4)
78
100
  sqlite3 (1.3.7)
101
+ terminal-table (1.4.5)
79
102
  thor (0.14.6)
80
103
  treetop (1.4.12)
81
104
  polyglot
82
105
  polyglot (>= 0.3.1)
83
- tzinfo (0.3.35)
106
+ tzinfo (0.3.37)
84
107
 
85
108
  PLATFORMS
86
109
  ruby
87
110
 
88
111
  DEPENDENCIES
89
112
  appraisal
113
+ guard-minitest
90
114
  minitest-emoji
115
+ minitest-focus
91
116
  minitest-spec-rails!
92
117
  rails (~> 3.0.0)
93
118
  rake
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source :rubygems
3
+ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 3.1.0"
6
6
 
@@ -2,11 +2,12 @@ PATH
2
2
  remote: /Users/kencollins/Repositories/minitest-spec-rails
3
3
  specs:
4
4
  minitest-spec-rails (4.3.8)
5
- minitest (~> 4.3)
5
+ minitest (~> 4.7)
6
+ minitest_tu_shim (~> 1.3.2)
6
7
  rails (>= 3.0)
7
8
 
8
9
  GEM
9
- remote: http://rubygems.org/
10
+ remote: https://rubygems.org/
10
11
  specs:
11
12
  actionmailer (3.1.10)
12
13
  actionpack (= 3.1.10)
@@ -41,19 +42,39 @@ GEM
41
42
  rake
42
43
  arel (2.2.3)
43
44
  builder (3.0.4)
45
+ coderay (1.0.9)
44
46
  erubis (2.7.0)
47
+ guard (1.6.2)
48
+ listen (>= 0.6.0)
49
+ lumberjack (>= 1.0.2)
50
+ pry (>= 0.9.10)
51
+ terminal-table (>= 1.4.3)
52
+ thor (>= 0.14.6)
53
+ guard-minitest (0.5.0)
54
+ guard (>= 0.4)
45
55
  hike (1.2.1)
46
- i18n (0.6.1)
56
+ i18n (0.6.4)
47
57
  json (1.7.7)
58
+ listen (0.7.3)
59
+ lumberjack (1.0.2)
48
60
  mail (2.3.3)
49
61
  i18n (>= 0.4.0)
50
62
  mime-types (~> 1.16)
51
63
  treetop (~> 1.4.8)
64
+ method_source (0.8.1)
52
65
  mime-types (1.21)
53
- minitest (4.6.0)
66
+ minitest (4.7.0)
54
67
  minitest-emoji (1.0.0)
68
+ minitest-focus (1.0.0)
69
+ minitest (~> 4.4)
70
+ minitest_tu_shim (1.3.2)
71
+ minitest (>= 1.6.0)
55
72
  multi_json (1.2.0)
56
73
  polyglot (0.3.3)
74
+ pry (0.9.12)
75
+ coderay (~> 1.0.5)
76
+ method_source (~> 0.8)
77
+ slop (~> 3.4)
57
78
  rack (1.3.9)
58
79
  rack-cache (1.2)
59
80
  rack (>= 0.4)
@@ -79,26 +100,30 @@ GEM
79
100
  rdoc (~> 3.4)
80
101
  thor (~> 0.14.6)
81
102
  rake (10.0.3)
82
- rdoc (3.12.1)
103
+ rdoc (3.12.2)
83
104
  json (~> 1.4)
105
+ slop (3.4.4)
84
106
  sprockets (2.0.4)
85
107
  hike (~> 1.2)
86
108
  rack (~> 1.0)
87
109
  tilt (~> 1.1, != 1.3.0)
88
110
  sqlite3 (1.3.7)
111
+ terminal-table (1.4.5)
89
112
  thor (0.14.6)
90
- tilt (1.3.3)
113
+ tilt (1.3.6)
91
114
  treetop (1.4.12)
92
115
  polyglot
93
116
  polyglot (>= 0.3.1)
94
- tzinfo (0.3.35)
117
+ tzinfo (0.3.37)
95
118
 
96
119
  PLATFORMS
97
120
  ruby
98
121
 
99
122
  DEPENDENCIES
100
123
  appraisal
124
+ guard-minitest
101
125
  minitest-emoji
126
+ minitest-focus
102
127
  minitest-spec-rails!
103
128
  rails (~> 3.1.0)
104
129
  rake
@@ -1,6 +1,6 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source :rubygems
3
+ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 3.2.0"
6
6
 
@@ -2,18 +2,19 @@ PATH
2
2
  remote: /Users/kencollins/Repositories/minitest-spec-rails
3
3
  specs:
4
4
  minitest-spec-rails (4.3.8)
5
- minitest (~> 4.3)
5
+ minitest (~> 4.7)
6
+ minitest_tu_shim (~> 1.3.2)
6
7
  rails (>= 3.0)
7
8
 
8
9
  GEM
9
- remote: http://rubygems.org/
10
+ remote: https://rubygems.org/
10
11
  specs:
11
- actionmailer (3.2.12)
12
- actionpack (= 3.2.12)
13
- mail (~> 2.4.4)
14
- actionpack (3.2.12)
15
- activemodel (= 3.2.12)
16
- activesupport (= 3.2.12)
12
+ actionmailer (3.2.13)
13
+ actionpack (= 3.2.13)
14
+ mail (~> 2.5.3)
15
+ actionpack (3.2.13)
16
+ activemodel (= 3.2.13)
17
+ activesupport (= 3.2.13)
17
18
  builder (~> 3.0.0)
18
19
  erubis (~> 2.7.0)
19
20
  journey (~> 1.0.4)
@@ -21,39 +22,59 @@ GEM
21
22
  rack-cache (~> 1.2)
22
23
  rack-test (~> 0.6.1)
23
24
  sprockets (~> 2.2.1)
24
- activemodel (3.2.12)
25
- activesupport (= 3.2.12)
25
+ activemodel (3.2.13)
26
+ activesupport (= 3.2.13)
26
27
  builder (~> 3.0.0)
27
- activerecord (3.2.12)
28
- activemodel (= 3.2.12)
29
- activesupport (= 3.2.12)
28
+ activerecord (3.2.13)
29
+ activemodel (= 3.2.13)
30
+ activesupport (= 3.2.13)
30
31
  arel (~> 3.0.2)
31
32
  tzinfo (~> 0.3.29)
32
- activeresource (3.2.12)
33
- activemodel (= 3.2.12)
34
- activesupport (= 3.2.12)
35
- activesupport (3.2.12)
36
- i18n (~> 0.6)
33
+ activeresource (3.2.13)
34
+ activemodel (= 3.2.13)
35
+ activesupport (= 3.2.13)
36
+ activesupport (3.2.13)
37
+ i18n (= 0.6.1)
37
38
  multi_json (~> 1.0)
38
39
  appraisal (0.5.1)
39
40
  bundler
40
41
  rake
41
42
  arel (3.0.2)
42
43
  builder (3.0.4)
44
+ coderay (1.0.9)
43
45
  erubis (2.7.0)
46
+ guard (1.6.2)
47
+ listen (>= 0.6.0)
48
+ lumberjack (>= 1.0.2)
49
+ pry (>= 0.9.10)
50
+ terminal-table (>= 1.4.3)
51
+ thor (>= 0.14.6)
52
+ guard-minitest (0.5.0)
53
+ guard (>= 0.4)
44
54
  hike (1.2.1)
45
55
  i18n (0.6.1)
46
56
  journey (1.0.4)
47
57
  json (1.7.7)
48
- mail (2.4.4)
58
+ listen (0.7.3)
59
+ lumberjack (1.0.2)
60
+ mail (2.5.3)
49
61
  i18n (>= 0.4.0)
50
62
  mime-types (~> 1.16)
51
63
  treetop (~> 1.4.8)
64
+ method_source (0.8.1)
52
65
  mime-types (1.21)
53
- minitest (4.6.0)
66
+ minitest (4.7.0)
54
67
  minitest-emoji (1.0.0)
55
- multi_json (1.6.0)
68
+ minitest-focus (1.0.0)
69
+ minitest (~> 4.4)
70
+ minitest_tu_shim (1.3.2)
71
+ minitest (>= 1.6.0)
72
+ multi_json (1.7.1)
56
73
  polyglot (0.3.3)
74
+ pry (0.9.12)
75
+ coderay (~> 1.0.5)
76
+ method_source (~> 0.8)
77
+ slop (~> 3.4)
57
78
  rack (1.4.5)
58
79
  rack-cache (1.2)
59
80
  rack (>= 0.4)
@@ -61,43 +82,47 @@ GEM
61
82
  rack
62
83
  rack-test (0.6.2)
63
84
  rack (>= 1.0)
64
- rails (3.2.12)
65
- actionmailer (= 3.2.12)
66
- actionpack (= 3.2.12)
67
- activerecord (= 3.2.12)
68
- activeresource (= 3.2.12)
69
- activesupport (= 3.2.12)
85
+ rails (3.2.13)
86
+ actionmailer (= 3.2.13)
87
+ actionpack (= 3.2.13)
88
+ activerecord (= 3.2.13)
89
+ activeresource (= 3.2.13)
90
+ activesupport (= 3.2.13)
70
91
  bundler (~> 1.0)
71
- railties (= 3.2.12)
72
- railties (3.2.12)
73
- actionpack (= 3.2.12)
74
- activesupport (= 3.2.12)
92
+ railties (= 3.2.13)
93
+ railties (3.2.13)
94
+ actionpack (= 3.2.13)
95
+ activesupport (= 3.2.13)
75
96
  rack-ssl (~> 1.3.2)
76
97
  rake (>= 0.8.7)
77
98
  rdoc (~> 3.4)
78
99
  thor (>= 0.14.6, < 2.0)
79
100
  rake (10.0.3)
80
- rdoc (3.12.1)
101
+ rdoc (3.12.2)
81
102
  json (~> 1.4)
103
+ slop (3.4.4)
82
104
  sprockets (2.2.2)
83
105
  hike (~> 1.2)
84
106
  multi_json (~> 1.0)
85
107
  rack (~> 1.0)
86
108
  tilt (~> 1.1, != 1.3.0)
87
109
  sqlite3 (1.3.7)
110
+ terminal-table (1.4.5)
88
111
  thor (0.17.0)
89
- tilt (1.3.3)
112
+ tilt (1.3.6)
90
113
  treetop (1.4.12)
91
114
  polyglot
92
115
  polyglot (>= 0.3.1)
93
- tzinfo (0.3.35)
116
+ tzinfo (0.3.37)
94
117
 
95
118
  PLATFORMS
96
119
  ruby
97
120
 
98
121
  DEPENDENCIES
99
122
  appraisal
123
+ guard-minitest
100
124
  minitest-emoji
125
+ minitest-focus
101
126
  minitest-spec-rails!
102
127
  rails (~> 3.2.0)
103
128
  rake
@@ -1,7 +1,7 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source :rubygems
3
+ source "https://rubygems.org"
4
4
 
5
- gem "rails", :github=>"rails/rails"
5
+ gem "rails", "~> 4.0.0.beta"
6
6
 
7
7
  gemspec :path=>"../"
@@ -1,107 +1,127 @@
1
- GIT
2
- remote: git://github.com/rails/rails.git
3
- revision: f8c8ad56c8a1cb48c6535fd8e248dcb9049e0aa3
1
+ PATH
2
+ remote: /Users/kencollins/Repositories/minitest-spec-rails
3
+ specs:
4
+ minitest-spec-rails (4.3.8)
5
+ minitest (~> 4.7)
6
+ minitest_tu_shim (~> 1.3.2)
7
+ rails (>= 3.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
4
11
  specs:
5
- actionmailer (4.0.0.beta)
6
- actionpack (= 4.0.0.beta)
12
+ actionmailer (4.0.0.beta1)
13
+ actionpack (= 4.0.0.beta1)
7
14
  mail (~> 2.5.3)
8
- actionpack (4.0.0.beta)
9
- activesupport (= 4.0.0.beta)
15
+ actionpack (4.0.0.beta1)
16
+ activesupport (= 4.0.0.beta1)
10
17
  builder (~> 3.1.0)
11
18
  erubis (~> 2.7.0)
12
19
  rack (~> 1.5.2)
13
- rack-test (~> 0.6.1)
14
- activemodel (4.0.0.beta)
15
- activesupport (= 4.0.0.beta)
20
+ rack-test (~> 0.6.2)
21
+ activemodel (4.0.0.beta1)
22
+ activesupport (= 4.0.0.beta1)
16
23
  builder (~> 3.1.0)
17
- activerecord (4.0.0.beta)
18
- activemodel (= 4.0.0.beta)
24
+ activerecord (4.0.0.beta1)
25
+ activemodel (= 4.0.0.beta1)
19
26
  activerecord-deprecated_finders (~> 0.0.3)
20
- activesupport (= 4.0.0.beta)
21
- arel (~> 3.0.2)
22
- activesupport (4.0.0.beta)
23
- i18n (~> 0.6)
24
- minitest (~> 4.1)
27
+ activesupport (= 4.0.0.beta1)
28
+ arel (~> 4.0.0.beta1)
29
+ activerecord-deprecated_finders (0.0.3)
30
+ activesupport (4.0.0.beta1)
31
+ i18n (~> 0.6.2)
32
+ minitest (~> 4.2)
25
33
  multi_json (~> 1.3)
26
34
  thread_safe (~> 0.1)
27
35
  tzinfo (~> 0.3.33)
28
- rails (4.0.0.beta)
29
- actionmailer (= 4.0.0.beta)
30
- actionpack (= 4.0.0.beta)
31
- activerecord (= 4.0.0.beta)
32
- activesupport (= 4.0.0.beta)
33
- bundler (>= 1.2.2, < 2.0)
34
- railties (= 4.0.0.beta)
35
- sprockets-rails (~> 2.0.0.rc1)
36
- railties (4.0.0.beta)
37
- actionpack (= 4.0.0.beta)
38
- activesupport (= 4.0.0.beta)
39
- rake (>= 0.8.7)
40
- rdoc (~> 3.4)
41
- thor (>= 0.17.0, < 2.0)
42
-
43
- PATH
44
- remote: /Users/kencollins/Repositories/minitest-spec-rails
45
- specs:
46
- minitest-spec-rails (4.3.8)
47
- minitest (~> 4.3)
48
- rails (>= 3.0)
49
-
50
- GEM
51
- remote: http://rubygems.org/
52
- specs:
53
- activerecord-deprecated_finders (0.0.3)
54
36
  appraisal (0.5.1)
55
37
  bundler
56
38
  rake
57
- arel (3.0.2)
39
+ arel (4.0.0.beta1)
58
40
  atomic (1.0.1)
59
41
  builder (3.1.4)
42
+ coderay (1.0.9)
60
43
  erubis (2.7.0)
44
+ guard (1.6.2)
45
+ listen (>= 0.6.0)
46
+ lumberjack (>= 1.0.2)
47
+ pry (>= 0.9.10)
48
+ terminal-table (>= 1.4.3)
49
+ thor (>= 0.14.6)
50
+ guard-minitest (0.5.0)
51
+ guard (>= 0.4)
61
52
  hike (1.2.1)
62
- i18n (0.6.1)
53
+ i18n (0.6.4)
63
54
  json (1.7.7)
55
+ listen (0.7.3)
56
+ lumberjack (1.0.2)
64
57
  mail (2.5.3)
65
58
  i18n (>= 0.4.0)
66
59
  mime-types (~> 1.16)
67
60
  treetop (~> 1.4.8)
61
+ method_source (0.8.1)
68
62
  mime-types (1.21)
69
- minitest (4.6.0)
63
+ minitest (4.7.0)
70
64
  minitest-emoji (1.0.0)
71
- multi_json (1.6.0)
65
+ minitest-focus (1.0.0)
66
+ minitest (~> 4.4)
67
+ minitest_tu_shim (1.3.2)
68
+ minitest (>= 1.6.0)
69
+ multi_json (1.7.1)
72
70
  polyglot (0.3.3)
71
+ pry (0.9.12)
72
+ coderay (~> 1.0.5)
73
+ method_source (~> 0.8)
74
+ slop (~> 3.4)
73
75
  rack (1.5.2)
74
76
  rack-test (0.6.2)
75
77
  rack (>= 1.0)
78
+ rails (4.0.0.beta1)
79
+ actionmailer (= 4.0.0.beta1)
80
+ actionpack (= 4.0.0.beta1)
81
+ activerecord (= 4.0.0.beta1)
82
+ activesupport (= 4.0.0.beta1)
83
+ bundler (>= 1.3.0, < 2.0)
84
+ railties (= 4.0.0.beta1)
85
+ sprockets-rails (~> 2.0.0.rc3)
86
+ railties (4.0.0.beta1)
87
+ actionpack (= 4.0.0.beta1)
88
+ activesupport (= 4.0.0.beta1)
89
+ rake (>= 0.8.7)
90
+ rdoc (~> 3.4)
91
+ thor (>= 0.17.0, < 2.0)
76
92
  rake (10.0.3)
77
- rdoc (3.12.1)
93
+ rdoc (3.12.2)
78
94
  json (~> 1.4)
79
- sprockets (2.8.2)
95
+ slop (3.4.4)
96
+ sprockets (2.9.0)
80
97
  hike (~> 1.2)
81
98
  multi_json (~> 1.0)
82
99
  rack (~> 1.0)
83
100
  tilt (~> 1.1, != 1.3.0)
84
- sprockets-rails (2.0.0.rc2)
101
+ sprockets-rails (2.0.0.rc3)
85
102
  actionpack (>= 3.0)
86
103
  activesupport (>= 3.0)
87
104
  sprockets (~> 2.8)
88
105
  sqlite3 (1.3.7)
106
+ terminal-table (1.4.5)
89
107
  thor (0.17.0)
90
108
  thread_safe (0.1.0)
91
109
  atomic
92
- tilt (1.3.3)
110
+ tilt (1.3.6)
93
111
  treetop (1.4.12)
94
112
  polyglot
95
113
  polyglot (>= 0.3.1)
96
- tzinfo (0.3.35)
114
+ tzinfo (0.3.37)
97
115
 
98
116
  PLATFORMS
99
117
  ruby
100
118
 
101
119
  DEPENDENCIES
102
120
  appraisal
121
+ guard-minitest
103
122
  minitest-emoji
123
+ minitest-focus
104
124
  minitest-spec-rails!
105
- rails!
125
+ rails (~> 4.0.0.beta)
106
126
  rake
107
127
  sqlite3
@@ -0,0 +1,52 @@
1
+ module MiniTestSpecRails
2
+ module DSL
3
+
4
+ RAILS_TEST_CASES = []
5
+
6
+ def self.included(klass)
7
+ klass.extend ClassMethods
8
+ end
9
+
10
+ module ClassMethods
11
+
12
+ def before(type = nil, &block)
13
+ setup { self.instance_eval(&block) }
14
+ end
15
+
16
+ def after(type = nil, &block)
17
+ teardown { self.instance_eval(&block) }
18
+ end
19
+
20
+ def rails_test_cases
21
+ RAILS_TEST_CASES
22
+ end
23
+
24
+ def register_rails_test_case(test_case)
25
+ return if RAILS_TEST_CASES.include?(test_case)
26
+ RAILS_TEST_CASES.unshift(test_case)
27
+ end
28
+
29
+ def describing_class
30
+ ancestors.detect { |a| Class === a && rails_test_cases.include?(a.superclass) }
31
+ end
32
+
33
+ def described_class
34
+ begin
35
+ describing_class.name.gsub(/Test$/, '').constantize
36
+ rescue NameError
37
+ nil
38
+ end
39
+ end
40
+
41
+ end
42
+
43
+ def describing_class
44
+ self.class.describing_class
45
+ end
46
+
47
+ def described_class
48
+ self.class.described_class
49
+ end
50
+
51
+ end
52
+ end
@@ -5,7 +5,9 @@ module MiniTestSpecRails
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- singleton_class.send :remove_method, :describe
8
+ singleton_class.class_eval { remove_method :describe }
9
+ extend MiniTest::Spec::DSL
10
+ include MiniTestSpecRails::DSL
9
11
  register_spec_type(self) { |desc| Class === desc && desc < ActiveRecord::Base if defined?(ActiveRecord::Base) }
10
12
  register_rails_test_case self
11
13
  end
@@ -16,6 +18,7 @@ end
16
18
 
17
19
  ActiveSupport::TestCase.send :include, MiniTestSpecRails::Init::ActiveSupportBehavior
18
20
 
21
+
19
22
  # The AbstractController::Helpers#default_helper_module! blows up using
20
23
  # ActiveSupport's modified LoadError class under Ruby 1.8 because describe
21
24
  # blocks with spaces for their names have a `module_path` of something like
@@ -6,8 +6,8 @@ module MiniTestSpecRails
6
6
 
7
7
  included do
8
8
  class << self
9
- alias :should :it
10
- alias :context :describe
9
+ alias :context :describe
10
+ alias :should :it
11
11
  end
12
12
  extend ClassMethods
13
13
  end
@@ -24,4 +24,4 @@ module MiniTestSpecRails
24
24
  end
25
25
  end
26
26
 
27
- MiniTest::Spec.send :include, MiniTestSpecRails::Init::MiniShouldaBehavior
27
+ ActiveSupport::TestCase.send :include, MiniTestSpecRails::Init::MiniShouldaBehavior
@@ -22,7 +22,6 @@ module MiniTestSpecRails
22
22
 
23
23
  initializer 'minitest-spec-rails.after.load_active_support', :after => :load_active_support, :group => :all do |app|
24
24
  if Rails.env.test?
25
- require 'minitest-spec-rails/init/active_support'
26
25
  require 'minitest-spec-rails/init/mini_shoulda' if app.config.minitest_spec_rails.mini_shoulda
27
26
  require 'minitest/autorun'
28
27
  end
@@ -1,3 +1,3 @@
1
1
  module MiniTestSpecRails
2
- VERSION = "4.3.8"
2
+ VERSION = "4.7.0"
3
3
  end
@@ -5,6 +5,6 @@ require 'rails'
5
5
  require 'minitest/spec'
6
6
  require 'minitest-spec-rails/util'
7
7
  require 'minitest-spec-rails/version'
8
+ require 'minitest-spec-rails/dsl'
8
9
  require 'minitest-spec-rails/railtie'
9
- require 'test/unit/testcase'
10
-
10
+ require 'minitest-spec-rails/init/active_support'
@@ -15,10 +15,13 @@ Gem::Specification.new do |gem|
15
15
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  gem.require_paths = ['lib']
18
- gem.add_runtime_dependency 'minitest', '~> 4.3'
19
- gem.add_runtime_dependency 'rails', '>= 3.0'
18
+ gem.add_runtime_dependency 'minitest', '~> 4.7'
19
+ gem.add_runtime_dependency 'rails', '>= 3.0'
20
+ gem.add_runtime_dependency 'minitest_tu_shim', '~> 1.3.2'
20
21
  gem.add_development_dependency 'appraisal'
22
+ gem.add_development_dependency 'guard-minitest'
21
23
  gem.add_development_dependency 'minitest-emoji'
24
+ gem.add_development_dependency 'minitest-focus'
22
25
  gem.add_development_dependency 'rake'
23
26
  gem.add_development_dependency 'sqlite3'
24
27
  end
@@ -4,10 +4,6 @@ class SomeRandomModel < ActiveRecord::Base; end
4
4
 
5
5
  class ActiveSupportTest < MiniTestSpecRails::TestCase
6
6
 
7
- it 'removes ActiveSupport describe method' do
8
- ActiveSupport::TestCase.singleton_methods(false).map(&:to_sym).wont_include :describe
9
- end
10
-
11
7
  it 'resolves spect type for active record constants' do
12
8
  assert_support MiniTest::Spec.spec_type(SomeRandomModel)
13
9
  assert_support MiniTest::Spec.spec_type(User)
@@ -17,7 +13,6 @@ class ActiveSupportTest < MiniTestSpecRails::TestCase
17
13
  assert_spec MiniTest::Spec.spec_type("Unmatched String")
18
14
  end
19
15
 
20
-
21
16
  private
22
17
 
23
18
  def assert_support(actual)
@@ -29,3 +24,20 @@ class ActiveSupportTest < MiniTestSpecRails::TestCase
29
24
  end
30
25
 
31
26
  end
27
+
28
+ class ActiveSupportCallbackTest < ActiveSupport::TestCase
29
+
30
+ setup :foo
31
+ setup :bar
32
+
33
+ it 'works' do
34
+ @foo.must_equal 'foo'
35
+ @bar.must_equal 'bar'
36
+ end
37
+
38
+ private
39
+
40
+ def foo ; @foo = 'foo' ; end
41
+ def bar ; @bar = 'bar' ; end
42
+
43
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-spec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.8
4
+ version: 4.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-13 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '4.3'
21
+ version: '4.7'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '4.3'
29
+ version: '4.7'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rails
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '3.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: minitest_tu_shim
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.3.2
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.2
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: appraisal
48
64
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +75,22 @@ dependencies:
59
75
  - - ! '>='
60
76
  - !ruby/object:Gem::Version
61
77
  version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: guard-minitest
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
62
94
  - !ruby/object:Gem::Dependency
63
95
  name: minitest-emoji
64
96
  requirement: !ruby/object:Gem::Requirement
@@ -75,6 +107,22 @@ dependencies:
75
107
  - - ! '>='
76
108
  - !ruby/object:Gem::Version
77
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: minitest-focus
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
78
126
  - !ruby/object:Gem::Dependency
79
127
  name: rake
80
128
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +168,7 @@ files:
120
168
  - Appraisals
121
169
  - CHANGELOG.md
122
170
  - Gemfile
171
+ - Guardfile
123
172
  - MIT-LICENSE
124
173
  - README.md
125
174
  - Rakefile
@@ -132,6 +181,7 @@ files:
132
181
  - gemfiles/rails40.gemfile
133
182
  - gemfiles/rails40.gemfile.lock
134
183
  - lib/minitest-spec-rails.rb
184
+ - lib/minitest-spec-rails/dsl.rb
135
185
  - lib/minitest-spec-rails/init/action_controller.rb
136
186
  - lib/minitest-spec-rails/init/action_dispatch.rb
137
187
  - lib/minitest-spec-rails/init/action_mailer.rb
@@ -141,9 +191,6 @@ files:
141
191
  - lib/minitest-spec-rails/railtie.rb
142
192
  - lib/minitest-spec-rails/util.rb
143
193
  - lib/minitest-spec-rails/version.rb
144
- - lib/test/unit.rb
145
- - lib/test/unit/assertions.rb
146
- - lib/test/unit/testcase.rb
147
194
  - minitest-spec-rails.gemspec
148
195
  - test/cases/action_controller_test.rb
149
196
  - test/cases/action_dispatch_test.rb
@@ -151,7 +198,6 @@ files:
151
198
  - test/cases/action_view_test.rb
152
199
  - test/cases/active_support_test.rb
153
200
  - test/cases/mini_shoulda_test.rb
154
- - test/cases/minitest_spec_rails_test.rb
155
201
  - test/dummy_app/app/controllers/application_controller.rb
156
202
  - test/dummy_app/app/controllers/users_controller.rb
157
203
  - test/dummy_app/app/helpers/application_helper.rb
@@ -190,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
236
  version: '0'
191
237
  segments:
192
238
  - 0
193
- hash: 3773355542300362759
239
+ hash: -886780920284122982
194
240
  required_rubygems_version: !ruby/object:Gem::Requirement
195
241
  none: false
196
242
  requirements:
@@ -199,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
245
  version: '0'
200
246
  segments:
201
247
  - 0
202
- hash: 3773355542300362759
248
+ hash: -886780920284122982
203
249
  requirements: []
204
250
  rubyforge_project:
205
251
  rubygems_version: 1.8.25
@@ -213,7 +259,6 @@ test_files:
213
259
  - test/cases/action_view_test.rb
214
260
  - test/cases/active_support_test.rb
215
261
  - test/cases/mini_shoulda_test.rb
216
- - test/cases/minitest_spec_rails_test.rb
217
262
  - test/dummy_app/app/controllers/application_controller.rb
218
263
  - test/dummy_app/app/controllers/users_controller.rb
219
264
  - test/dummy_app/app/helpers/application_helper.rb
@@ -1,5 +0,0 @@
1
- module Test
2
- module Unit
3
- Assertions = ::MiniTest::Assertions
4
- end
5
- end
@@ -1,67 +0,0 @@
1
- require 'minitest-spec-rails'
2
- require 'pp'
3
-
4
- module Test
5
- module Unit
6
-
7
- remove_const(:TestCase) if defined?(self::TestCase)
8
- class TestCase < ::MiniTest::Spec
9
-
10
- # Let Others Know
11
-
12
- MINITEST_SPEC_RAILS = true
13
-
14
- # Test::Unit Compatability
15
-
16
- def mu_pp(obj)
17
- obj.pretty_inspect.chomp
18
- end
19
-
20
- def assert_block(*msgs)
21
- assert yield, *msgs
22
- end
23
-
24
- def build_message(head, template=nil, *arguments)
25
- template &&= template.chomp
26
- template.gsub(/\G((?:[^\\]|\\.)*?)(\\)?\?/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) }
27
- end
28
-
29
- # MiniTestSpecRails Additions
30
-
31
- RAILS_TEST_CASES = []
32
-
33
- def self.rails_test_cases
34
- RAILS_TEST_CASES
35
- end
36
-
37
- def self.register_rails_test_case(test_case)
38
- return if RAILS_TEST_CASES.include?(test_case)
39
- RAILS_TEST_CASES.unshift(test_case)
40
- end
41
-
42
- def self.describing_class
43
- ancestors.detect { |a| Class === a && rails_test_cases.include?(a.superclass) }
44
- end
45
-
46
- def describing_class
47
- self.class.describing_class
48
- end
49
-
50
- def self.described_class
51
- begin
52
- describing_class.name.gsub(/Test$/, '').constantize
53
- rescue NameError
54
- nil
55
- end
56
- end
57
-
58
- def described_class
59
- self.class.described_class
60
- end
61
-
62
- end
63
-
64
- end
65
- end
66
-
67
- silence_warnings { MiniTest::Unit::TestCase = Test::Unit::TestCase } unless MiniTestSpecRails::Util.rails3?
data/lib/test/unit.rb DELETED
@@ -1,5 +0,0 @@
1
- module Test
2
- module Unit
3
- TEST_UNIT_IMPLEMENTATION = 'test/unit mock using minitest-spec-rails'
4
- end
5
- end
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- class MiniTestSpecRailsTest < MiniTestSpecRails::TestCase
4
-
5
- it 'defines MINITEST_SPEC_RAILS in the Test::Unit::TestCase shim' do
6
- assert Test::Unit::TestCase.const_defined? :MINITEST_SPEC_RAILS
7
- assert Test::Unit::TestCase::MINITEST_SPEC_RAILS
8
- end
9
-
10
-
11
- end