spicycode-micronaut-rails 0.0.6.1 → 0.0.6.2
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.
|
@@ -13,5 +13,32 @@ describe Micronaut::Rails::Configuration do
|
|
|
13
13
|
it "should add an #enable_active_record_transactional_support method" do
|
|
14
14
|
Micronaut.configuration.should respond_to(:enable_active_record_transactional_support)
|
|
15
15
|
end
|
|
16
|
+
|
|
17
|
+
describe "helpers for standard Rails testing support" do
|
|
18
|
+
|
|
19
|
+
method_to_modules = { :enable_helper_support => Micronaut::Rails::Helpers,
|
|
20
|
+
:enable_active_record_transactional_support => Micronaut::Rails::TransactionalDatabaseSupport,
|
|
21
|
+
:enable_controller_support => Micronaut::Rails::Controllers
|
|
22
|
+
}
|
|
23
|
+
method_to_modules.each do |method, mod|
|
|
24
|
+
example "##{method} with no filter options" do
|
|
25
|
+
Micronaut.configuration.send(method)
|
|
26
|
+
Micronaut.configuration.extra_modules.should include([:extend, mod, {}])
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
example "##{method} with filter options" do
|
|
30
|
+
filter_options = {:options => { "foo" => "bar" } }
|
|
31
|
+
Micronaut.configuration.send(method, filter_options)
|
|
32
|
+
Micronaut.configuration.extra_modules.should include([:extend, mod, filter_options])
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
example "#enable_rails_specific_mocking_extensions for mocha with no filter options" do
|
|
37
|
+
Micronaut.configuration.mock_with :mocha
|
|
38
|
+
Micronaut.configuration.enable_rails_specific_mocking_extensions
|
|
39
|
+
Micronaut.configuration.extra_modules.should include([:include, Micronaut::Rails::Mocking::WithMocha, {}])
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
16
43
|
|
|
17
44
|
end
|
|
@@ -9,36 +9,24 @@ module Micronaut
|
|
|
9
9
|
|
|
10
10
|
# :behaviour => { :describes => lambda { |dt| dt < ActiveRecord::Base }
|
|
11
11
|
def enable_active_record_transactional_support(filter_options={})
|
|
12
|
-
|
|
13
|
-
::Micronaut::Behaviour.send(:extend, ::Micronaut::Rails::TransactionalDatabaseSupport)
|
|
14
|
-
else
|
|
15
|
-
::Micronaut.config.extend(::Micronaut::Rails::TransactionalDatabaseSupport, filter_options)
|
|
16
|
-
end
|
|
12
|
+
::Micronaut.configuration.extend(::Micronaut::Rails::TransactionalDatabaseSupport, filter_options)
|
|
17
13
|
end
|
|
18
14
|
|
|
19
15
|
# :behaviour => { :describes => lambda { |dt| dt.to_s.ends_with?('Helper') }
|
|
20
16
|
def enable_helper_support(filter_options={})
|
|
21
|
-
|
|
22
|
-
::Micronaut::Behaviour.send(:extend, ::Micronaut::Rails::Helpers)
|
|
23
|
-
else
|
|
24
|
-
::Micronaut.config.extend(::Micronaut::Rails::Helpers, filter_options)
|
|
25
|
-
end
|
|
17
|
+
::Micronaut.configuration.extend(::Micronaut::Rails::Helpers, filter_options)
|
|
26
18
|
end
|
|
27
19
|
|
|
28
20
|
# :behaviour => { :describes => lambda { |dt| dt < ActionController::Base }
|
|
29
21
|
def enable_controller_support(filter_options={})
|
|
30
|
-
|
|
31
|
-
::Micronaut::Behaviour.send(:extend, ::Micronaut::Rails::Controllers)
|
|
32
|
-
else
|
|
33
|
-
::Micronaut.config.extend(::Micronaut::Rails::Controllers, filter_options)
|
|
34
|
-
end
|
|
22
|
+
::Micronaut.configuration.extend(::Micronaut::Rails::Controllers, filter_options)
|
|
35
23
|
end
|
|
36
24
|
|
|
37
|
-
def enable_rails_specific_mocking_extensions
|
|
38
|
-
case ::Micronaut.
|
|
25
|
+
def enable_rails_specific_mocking_extensions(filter_options={})
|
|
26
|
+
case ::Micronaut.configuration.mock_framework.to_s
|
|
39
27
|
when /mocha/i
|
|
40
28
|
require 'micronaut/rails/mocking/with_mocha'
|
|
41
|
-
Micronaut
|
|
29
|
+
::Micronaut.configuration.include(::Micronaut::Rails::Mocking::WithMocha, filter_options)
|
|
42
30
|
end
|
|
43
31
|
end
|
|
44
32
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spicycode-micronaut-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.6.
|
|
4
|
+
version: 0.0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chad Humphries
|
|
@@ -9,7 +9,7 @@ autorequire: micronaut-rails
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-12-
|
|
12
|
+
date: 2008-12-28 00:00:00 -08:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|