minitest-spec-rails-orangejulius 5.0.3.pre.orangejulius

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.travis.yml +12 -0
  4. data/Appraisals +3 -0
  5. data/CHANGELOG.md +142 -0
  6. data/Gemfile +4 -0
  7. data/MIT-LICENSE +22 -0
  8. data/README.md +290 -0
  9. data/Rakefile +19 -0
  10. data/lib/minitest-spec-rails/dsl.rb +41 -0
  11. data/lib/minitest-spec-rails/init/action_controller.rb +26 -0
  12. data/lib/minitest-spec-rails/init/action_dispatch.rb +16 -0
  13. data/lib/minitest-spec-rails/init/action_mailer.rb +27 -0
  14. data/lib/minitest-spec-rails/init/action_view.rb +26 -0
  15. data/lib/minitest-spec-rails/init/active_support.rb +35 -0
  16. data/lib/minitest-spec-rails/init/mini_shoulda.rb +27 -0
  17. data/lib/minitest-spec-rails/railtie.rb +28 -0
  18. data/lib/minitest-spec-rails/version.rb +3 -0
  19. data/lib/minitest-spec-rails.rb +10 -0
  20. data/minitest-spec-rails.gemspec +24 -0
  21. data/test/cases/action_controller_test.rb +41 -0
  22. data/test/cases/action_dispatch_test.rb +50 -0
  23. data/test/cases/action_mailer_test.rb +42 -0
  24. data/test/cases/action_view_test.rb +44 -0
  25. data/test/cases/active_support_test.rb +68 -0
  26. data/test/cases/mini_shoulda_test.rb +38 -0
  27. data/test/dummy_app/app/controllers/application_controller.rb +7 -0
  28. data/test/dummy_app/app/controllers/users_controller.rb +12 -0
  29. data/test/dummy_app/app/helpers/application_helper.rb +3 -0
  30. data/test/dummy_app/app/helpers/foos_helper.rb +11 -0
  31. data/test/dummy_app/app/helpers/users_helper.rb +9 -0
  32. data/test/dummy_app/app/mailers/user_mailer.rb +10 -0
  33. data/test/dummy_app/app/models/post.rb +6 -0
  34. data/test/dummy_app/app/models/user.rb +6 -0
  35. data/test/dummy_app/app/views/users/index.html.erb +2 -0
  36. data/test/dummy_app/config/database.yml +6 -0
  37. data/test/dummy_app/config/routes.rb +4 -0
  38. data/test/dummy_app/init.rb +38 -0
  39. data/test/dummy_app/lib/library.rb +2 -0
  40. data/test/dummy_app/tmp/.gitkeep +0 -0
  41. data/test/dummy_tests/application_controller_test.rb +87 -0
  42. data/test/dummy_tests/foos_helper_test.rb +17 -0
  43. data/test/dummy_tests/integration_test.rb +49 -0
  44. data/test/dummy_tests/library_test.rb +15 -0
  45. data/test/dummy_tests/user_mailer_test.rb +85 -0
  46. data/test/dummy_tests/user_test.rb +76 -0
  47. data/test/dummy_tests/users_controller_test.rb +26 -0
  48. data/test/dummy_tests/users_helper_test.rb +77 -0
  49. data/test/support/shared_test_case_behavior.rb +31 -0
  50. data/test/test_helper.rb +11 -0
  51. data/test/test_helper_dummy.rb +9 -0
  52. metadata +196 -0
@@ -0,0 +1,49 @@
1
+ require 'test_helper_dummy'
2
+
3
+ module IntegrationTests
4
+ extend ActiveSupport::Concern
5
+ included do
6
+
7
+ fixtures :all
8
+
9
+ it 'works' do
10
+ get root_path
11
+ status.must_equal 200
12
+ end
13
+
14
+ it 'works with assert_routing' do
15
+ assert_routing '/', :controller => 'application', :action => 'index'
16
+ end
17
+
18
+ it 'can find the app' do
19
+ app.must_be_instance_of Dummy::Application
20
+ end
21
+
22
+ describe 'nested 1' do
23
+
24
+ it('works') { skip }
25
+
26
+ it 'can find the app' do
27
+ app.must_be_instance_of Dummy::Application
28
+ end
29
+
30
+ describe 'nested 2' do
31
+
32
+ it('works') { skip }
33
+
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+ end
40
+
41
+ class IntegrationTest < ActionDispatch::IntegrationTest
42
+ include IntegrationTests
43
+ end
44
+
45
+ class AppTest < ActionDispatch::IntegrationTest
46
+ def test_homepage
47
+ assert_routing '/', :controller => 'application', :action => 'index'
48
+ end
49
+ end
@@ -0,0 +1,15 @@
1
+ require 'test_helper_dummy'
2
+ require "#{Dummy::Application.root}/lib/library"
3
+
4
+ class LibraryTest < ActiveSupport::TestCase
5
+ it 'reflects' do
6
+ described_class.must_equal Library
7
+ end
8
+ end
9
+
10
+ describe Library do
11
+ it 'reflects' do
12
+ described_class.must_equal Library
13
+ self.class.described_class.must_equal Library
14
+ end
15
+ end
@@ -0,0 +1,85 @@
1
+ require 'test_helper_dummy'
2
+
3
+ module UserMailerTests
4
+ extend ActiveSupport::Concern
5
+ included do
6
+
7
+ let(:deliveries) { ActionMailer::Base.deliveries }
8
+ let(:user_mailer_class) { UserMailer }
9
+ let(:user_email) { user_mailer_class.welcome(user_ken).deliver }
10
+
11
+ it 'works' do
12
+ deliveries.must_be :empty?
13
+ user_email
14
+ deliveries.wont_be :empty?
15
+ user_email.to.must_equal [user_ken.email]
16
+ user_email.from.must_equal ['rails@minitest.spec']
17
+ user_email.body.encoded.must_equal "Welcome to MiniTest::Spec #{user_ken.email}!"
18
+ end
19
+
20
+ it 'allows custom assertions' do
21
+ assert_emails(1) { user_email }
22
+ end
23
+
24
+ it 'can find the mailer_class' do
25
+ self.class.mailer_class.must_equal user_mailer_class
26
+ end
27
+
28
+ describe 'nested 1' do
29
+
30
+ it('works') { skip }
31
+
32
+ it 'can find the mailer_class' do
33
+ self.class.mailer_class.must_equal user_mailer_class
34
+ end
35
+
36
+ describe 'nested 2' do
37
+
38
+ it('works') { skip }
39
+
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
46
+
47
+ class UserMailerTest < ActionMailer::TestCase
48
+ include UserMailerTests
49
+ it 'reflects' do
50
+ described_class.must_equal UserMailer
51
+ self.class.described_class.must_equal UserMailer
52
+ end
53
+ describe 'level 1' do
54
+ it 'reflects' do
55
+ described_class.must_equal UserMailer
56
+ self.class.described_class.must_equal UserMailer
57
+ end
58
+ describe 'level 2' do
59
+ it 'reflects' do
60
+ described_class.must_equal UserMailer
61
+ self.class.described_class.must_equal UserMailer
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ describe UserMailer do
68
+ include UserMailerTests
69
+ it 'reflects' do
70
+ described_class.must_equal UserMailer
71
+ self.class.described_class.must_equal UserMailer
72
+ end
73
+ describe 'level 1' do
74
+ it 'reflects' do
75
+ described_class.must_equal UserMailer
76
+ self.class.described_class.must_equal UserMailer
77
+ end
78
+ describe 'level 2' do
79
+ it 'reflects' do
80
+ described_class.must_equal UserMailer
81
+ self.class.described_class.must_equal UserMailer
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,76 @@
1
+ require 'test_helper_dummy'
2
+
3
+ module UserTests
4
+ extend ActiveSupport::Concern
5
+ included do
6
+
7
+ it 'works' do
8
+ user_ken.must_be_instance_of User
9
+ end
10
+
11
+ test 'works with test' do
12
+ user_ken.must_be_instance_of User
13
+ end
14
+
15
+ it 'allows custom assertions' do
16
+ assert_not false
17
+ end
18
+
19
+ describe 'nested 1' do
20
+
21
+ it('works') { skip }
22
+
23
+ describe 'nested 2' do
24
+
25
+ it('works') { skip }
26
+
27
+ end
28
+
29
+ test 'works with test' do
30
+ user_ken.must_be_instance_of User
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+ end
37
+
38
+ class UserTest < ActiveSupport::TestCase
39
+ include UserTests
40
+ it 'reflects' do
41
+ described_class.must_equal User
42
+ self.class.described_class.must_equal User
43
+ end
44
+ describe 'level 1' do
45
+ it 'reflects' do
46
+ described_class.must_equal User
47
+ self.class.described_class.must_equal User
48
+ end
49
+ describe 'level 2' do
50
+ it 'reflects' do
51
+ described_class.must_equal User
52
+ self.class.described_class.must_equal User
53
+ end
54
+ end
55
+ end
56
+ end
57
+
58
+ describe User do
59
+ include UserTests
60
+ it 'reflects' do
61
+ described_class.must_equal User
62
+ self.class.described_class.must_equal User
63
+ end
64
+ describe 'level 1' do
65
+ it 'reflects' do
66
+ described_class.must_equal User
67
+ self.class.described_class.must_equal User
68
+ end
69
+ describe 'level 2' do
70
+ it 'reflects' do
71
+ described_class.must_equal User
72
+ self.class.described_class.must_equal User
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,26 @@
1
+ require 'test_helper_dummy'
2
+
3
+ module UsersControllerTests
4
+ extend ActiveSupport::Concern
5
+ included do
6
+
7
+ it 'works' do
8
+ get :index
9
+ assert_select 'h1', "All #{User.count} Users"
10
+ end
11
+
12
+ it 'redirects' do
13
+ put :update, :id => 0
14
+ assert_redirected_to users_url
15
+ end
16
+
17
+ end
18
+ end
19
+
20
+ class UsersControllerTest < ActionController::TestCase
21
+ include UsersControllerTests
22
+ end
23
+
24
+ describe UsersController do
25
+ include UsersControllerTests
26
+ end
@@ -0,0 +1,77 @@
1
+ require 'test_helper_dummy'
2
+
3
+ module UsersHelperTests
4
+ extend ActiveSupport::Concern
5
+ included do
6
+
7
+ let(:users_list) { render_users_list User.all }
8
+
9
+ before { user_ken }
10
+
11
+ it 'works' do
12
+ user_ken
13
+ users_list.must_equal "<ul><li>#{user_ken.email}</li></ul>"
14
+ end
15
+
16
+ it 'can find the helper_class' do
17
+ self.class.helper_class.must_equal UsersHelper
18
+ end
19
+
20
+ describe 'nested 1' do
21
+
22
+ it('works') { skip }
23
+
24
+ it 'can find the helper_class' do
25
+ self.class.helper_class.must_equal UsersHelper
26
+ end
27
+
28
+ describe 'nested 2' do
29
+
30
+ it('works') { skip }
31
+
32
+ end
33
+
34
+ end
35
+
36
+ end
37
+ end
38
+
39
+ class UsersHelperTest < ActionView::TestCase
40
+ include UsersHelperTests
41
+ it 'reflects' do
42
+ described_class.must_equal UsersHelper
43
+ self.class.described_class.must_equal UsersHelper
44
+ end
45
+ describe 'level 1' do
46
+ it 'reflects' do
47
+ described_class.must_equal UsersHelper
48
+ self.class.described_class.must_equal UsersHelper
49
+ end
50
+ describe 'level 2' do
51
+ it 'reflects' do
52
+ described_class.must_equal UsersHelper
53
+ self.class.described_class.must_equal UsersHelper
54
+ end
55
+ end
56
+ end
57
+ end
58
+
59
+ describe UsersHelper do
60
+ include UsersHelperTests
61
+ it 'reflects' do
62
+ described_class.must_equal UsersHelper
63
+ self.class.described_class.must_equal UsersHelper
64
+ end
65
+ describe 'level 1' do
66
+ it 'reflects' do
67
+ described_class.must_equal UsersHelper
68
+ self.class.described_class.must_equal UsersHelper
69
+ end
70
+ describe 'level 2' do
71
+ it 'reflects' do
72
+ described_class.must_equal UsersHelper
73
+ self.class.described_class.must_equal UsersHelper
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,31 @@
1
+ module MiniTestSpecRails
2
+ module SharedTestCaseBehavior
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ before { setup_dummy_schema }
8
+ let(:app) { Dummy::Application }
9
+ let(:user_ken) { User.create! :email => 'ken@metaskills.net' }
10
+ let(:user_post) { Post.create! :title => 'Test Title', :body => 'Test body. Test body.', :user => user_ken}
11
+ end
12
+
13
+ private
14
+
15
+ def setup_dummy_schema
16
+ ActiveRecord::Base.class_eval do
17
+ connection.instance_eval do
18
+ create_table :users, :force => true do |t|
19
+ t.string :email
20
+ end
21
+ create_table :posts, :force => true do |t|
22
+ t.string :title, :body
23
+ t.integer :user_id
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+
@@ -0,0 +1,11 @@
1
+ require 'dummy_app/init'
2
+ require 'support/shared_test_case_behavior'
3
+
4
+ module MiniTestSpecRails
5
+ class TestCase < MiniTest::Spec
6
+
7
+ include MiniTestSpecRails::SharedTestCaseBehavior
8
+
9
+
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class ActiveSupport::TestCase
4
+
5
+ fixtures :all
6
+ include MiniTestSpecRails::SharedTestCaseBehavior
7
+
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-spec-rails-orangejulius
3
+ version: !ruby/object:Gem::Version
4
+ version: 5.0.3.pre.orangejulius
5
+ platform: ruby
6
+ authors:
7
+ - Ken Collins
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 4.1.0.rc2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 4.1.0.rc2
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sqlite3
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: The minitest-spec-rails gem makes it easy to use the MiniTest::Spec DSL
84
+ within your existing Rails 3 or 4 test suite.
85
+ email:
86
+ - ken@metaskills.net
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - .gitignore
92
+ - .travis.yml
93
+ - Appraisals
94
+ - CHANGELOG.md
95
+ - Gemfile
96
+ - MIT-LICENSE
97
+ - README.md
98
+ - Rakefile
99
+ - lib/minitest-spec-rails.rb
100
+ - lib/minitest-spec-rails/dsl.rb
101
+ - lib/minitest-spec-rails/init/action_controller.rb
102
+ - lib/minitest-spec-rails/init/action_dispatch.rb
103
+ - lib/minitest-spec-rails/init/action_mailer.rb
104
+ - lib/minitest-spec-rails/init/action_view.rb
105
+ - lib/minitest-spec-rails/init/active_support.rb
106
+ - lib/minitest-spec-rails/init/mini_shoulda.rb
107
+ - lib/minitest-spec-rails/railtie.rb
108
+ - lib/minitest-spec-rails/version.rb
109
+ - minitest-spec-rails.gemspec
110
+ - test/cases/action_controller_test.rb
111
+ - test/cases/action_dispatch_test.rb
112
+ - test/cases/action_mailer_test.rb
113
+ - test/cases/action_view_test.rb
114
+ - test/cases/active_support_test.rb
115
+ - test/cases/mini_shoulda_test.rb
116
+ - test/dummy_app/app/controllers/application_controller.rb
117
+ - test/dummy_app/app/controllers/users_controller.rb
118
+ - test/dummy_app/app/helpers/application_helper.rb
119
+ - test/dummy_app/app/helpers/foos_helper.rb
120
+ - test/dummy_app/app/helpers/users_helper.rb
121
+ - test/dummy_app/app/mailers/user_mailer.rb
122
+ - test/dummy_app/app/models/post.rb
123
+ - test/dummy_app/app/models/user.rb
124
+ - test/dummy_app/app/views/users/index.html.erb
125
+ - test/dummy_app/config/database.yml
126
+ - test/dummy_app/config/routes.rb
127
+ - test/dummy_app/init.rb
128
+ - test/dummy_app/lib/library.rb
129
+ - test/dummy_app/tmp/.gitkeep
130
+ - test/dummy_tests/application_controller_test.rb
131
+ - test/dummy_tests/foos_helper_test.rb
132
+ - test/dummy_tests/integration_test.rb
133
+ - test/dummy_tests/library_test.rb
134
+ - test/dummy_tests/user_mailer_test.rb
135
+ - test/dummy_tests/user_test.rb
136
+ - test/dummy_tests/users_controller_test.rb
137
+ - test/dummy_tests/users_helper_test.rb
138
+ - test/support/shared_test_case_behavior.rb
139
+ - test/test_helper.rb
140
+ - test/test_helper_dummy.rb
141
+ homepage: http://github.com/metaskills/minitest-spec-rails
142
+ licenses:
143
+ - MIT
144
+ metadata: {}
145
+ post_install_message:
146
+ rdoc_options: []
147
+ require_paths:
148
+ - lib
149
+ required_ruby_version: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - '>'
157
+ - !ruby/object:Gem::Version
158
+ version: 1.3.1
159
+ requirements: []
160
+ rubyforge_project:
161
+ rubygems_version: 2.1.11
162
+ signing_key:
163
+ specification_version: 4
164
+ summary: Make Rails Use MiniTest::Spec!
165
+ test_files:
166
+ - test/cases/action_controller_test.rb
167
+ - test/cases/action_dispatch_test.rb
168
+ - test/cases/action_mailer_test.rb
169
+ - test/cases/action_view_test.rb
170
+ - test/cases/active_support_test.rb
171
+ - test/cases/mini_shoulda_test.rb
172
+ - test/dummy_app/app/controllers/application_controller.rb
173
+ - test/dummy_app/app/controllers/users_controller.rb
174
+ - test/dummy_app/app/helpers/application_helper.rb
175
+ - test/dummy_app/app/helpers/foos_helper.rb
176
+ - test/dummy_app/app/helpers/users_helper.rb
177
+ - test/dummy_app/app/mailers/user_mailer.rb
178
+ - test/dummy_app/app/models/post.rb
179
+ - test/dummy_app/app/models/user.rb
180
+ - test/dummy_app/app/views/users/index.html.erb
181
+ - test/dummy_app/config/database.yml
182
+ - test/dummy_app/config/routes.rb
183
+ - test/dummy_app/init.rb
184
+ - test/dummy_app/lib/library.rb
185
+ - test/dummy_app/tmp/.gitkeep
186
+ - test/dummy_tests/application_controller_test.rb
187
+ - test/dummy_tests/foos_helper_test.rb
188
+ - test/dummy_tests/integration_test.rb
189
+ - test/dummy_tests/library_test.rb
190
+ - test/dummy_tests/user_mailer_test.rb
191
+ - test/dummy_tests/user_test.rb
192
+ - test/dummy_tests/users_controller_test.rb
193
+ - test/dummy_tests/users_helper_test.rb
194
+ - test/support/shared_test_case_behavior.rb
195
+ - test/test_helper.rb
196
+ - test/test_helper_dummy.rb