scorpion-ioc 0.6.0 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5315d42c953ef2d6cbdd91f5cbdfb022446cb809
4
- data.tar.gz: c532df0cf7a914d1b90dca8525f73b9da5e71328
3
+ metadata.gz: 5e1ee73f894ab57634fbe1f1eb2a162b469cb569
4
+ data.tar.gz: e4f8915f1d95b9ad6f0e6545207c10c3de3d0a8c
5
5
  SHA512:
6
- metadata.gz: 162246ea77d34ff5b08f8d618a06dcbacfe0acda81aa9e97550873e776da7a348a5446ddf97b12747accbb2f673cd414f0c5ae292c83b22e6d8ffcd43cf14748
7
- data.tar.gz: 076ab0215464ce508c78cadb67782fb090a212d8bbacaf57d47495f4512f11a324d1ac5d09bc35698f4d763811f9e3a720ca9ba6135cb1b9a9abb87252d58b09
6
+ metadata.gz: 0b6a6c1f1aabee3940ffff6a326445a4a30bcd3c0ebf6582411fd2b644ae131b34756de4036c5f63b8e20884f2d130a94f4743b49fb60d938075d8e679fe022d
7
+ data.tar.gz: 4dd7b17c65d5706f475ad69894bf1fdd63fa549a329a9ffe0d1e6e872b56c8b3883717d319f63d0cff36b835bf952559e56d93af415ade1d49f1db6805f6c889
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.3.1
data/bin/rspec ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rspec' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require "pathname"
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require "rubygems"
15
+ require "bundler/setup"
16
+
17
+ load Gem.bin_path("rspec-core", "rspec")
@@ -11,6 +11,21 @@ module Scorpion
11
11
  base.infest_nest ActiveJob::Base if defined? ActiveJob::Base
12
12
  base.infest_nest ActionMailer::Base if defined? ActionMailer::Base
13
13
 
14
+ base.before( :each ) do
15
+ allow( Scorpion ).to receive( :instance ) do
16
+ # Always override the 'global' scorpion with the scorpion from the
17
+ # spec. Any existing nests will not be affected, only code the
18
+ # naively reaches into global scorpion context.
19
+ @@global_scorpion_warned ||=
20
+ begin
21
+ puts( "Using global scorpion is not recommended. Objects should be created with scorpion.fetch or scorpion.new" )
22
+ true
23
+ end
24
+
25
+ scorpion
26
+ end
27
+ end
28
+
14
29
  super
15
30
  end
16
31
 
@@ -1,5 +1,5 @@
1
1
  module Scorpion
2
- VERSION_NUMBER = "0.6.0"
2
+ VERSION_NUMBER = "0.6.1"
3
3
  VERSION_SUFFIX = ""
4
4
  VERSION = "#{VERSION_NUMBER}#{VERSION_SUFFIX}"
5
5
  end
@@ -57,19 +57,25 @@ describe Scorpion::Rails::Controller, type: :controller do
57
57
  end
58
58
 
59
59
  it "retrieves scorpion from `env`" do
60
- expect( subject.env ).to receive( :[] )
61
- .with( Scorpion::Rails::Controller::ENV_KEY )
62
- .at_least( :once )
63
- .and_call_original
60
+ expect( subject ).to receive( :scorpion ).at_least( :once ).and_wrap_original do |method, *args|
61
+ scorpion = method.call( *args )
62
+ expect( scorpion ).to be subject.request.env[ Scorpion::Rails::Controller::ENV_KEY ]
63
+
64
+ scorpion
65
+ end
64
66
 
65
67
  get :index
66
68
  end
67
69
 
68
70
  it "stores the scorpion in `env`" do
69
- expect( subject.env ).to receive( :[]= )
70
- .with( Scorpion::Rails::Controller::ENV_KEY, kind_of( Scorpion ) )
71
- .at_least( :once )
72
- .and_call_original
71
+ expect( subject ).to receive( :assign_scorpion ).and_wrap_original do |method, *args|
72
+ expect( subject.request.env ).to receive( :[]= )
73
+ .with( Scorpion::Rails::Controller::ENV_KEY, kind_of( Scorpion ) )
74
+ .at_least( :once )
75
+ .and_call_original
76
+
77
+ method.call( *args )
78
+ end
73
79
 
74
80
  get :index
75
81
  end
@@ -171,4 +177,4 @@ describe Scorpion::Rails::Controller, type: :controller do
171
177
  get :index
172
178
  end
173
179
  end
174
- end
180
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scorpion-ioc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Alexander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -112,7 +112,8 @@ description: Embrace convention over configuration while still benefitting from
112
112
  injection design principles.
113
113
  email:
114
114
  - me@phallguy.com
115
- executables: []
115
+ executables:
116
+ - rspec
116
117
  extensions: []
117
118
  extra_rdoc_files: []
118
119
  files:
@@ -128,6 +129,7 @@ files:
128
129
  - LICENSE
129
130
  - README.md
130
131
  - Rakefile
132
+ - bin/rspec
131
133
  - circle.yml
132
134
  - config.ru
133
135
  - lib/scorpion-ioc.rb