lookout-rack-test 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGM2N2IwZjk2NTliNDk3ZDMwYTNlMDI3ODBkNDZmYzhhMGRmMTQ4Ng==
4
+ ZGI4YjI5MmQxZjVhMWNhNDJlZDQxYWIwOGZiMzk0YzU0NzAwYzM0MA==
5
5
  data.tar.gz: !binary |-
6
- NTk2MzA5ZDJlNWU5ZGY5MGY2NDc1NzFkNmIxNmYzNWRkYjNhYzE2OQ==
6
+ ZjlhMzVlOGE3ZWU4Mzc3MTc1YTcxNGE5MmM5ZTc0ZmIzY2Y4MDFjYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWUxMDBjYjFmOTIxZmEyM2YyNTliODcxOGNkY2NjMGQ5NmJmNWYwY2MyZWYz
10
- ODBjNzg0OGFkMmI0MTJlZmEwMDcxYWFkOTIzODk2NDczOGFiMGNkZjQ2OGVl
11
- OGYxOGU2ZjJmMTI3ODUyMzRiNjczMzNiNTU3YTVjMDE4MjFmNzA=
9
+ N2I3Y2RjMjNmNDE0YjJhNWRhZWI4MWY3YTRmZmEwNmRjY2RmOTFlMGFlZjFi
10
+ MmUxZjhlODAyN2YyMjVhODY0NTIyZjVhYWQ5OTU5YTQ1NzE3YWU2YjNiM2E0
11
+ Njg2MzdjMDZiZDQ2ZWQwZTM1ZGI2YTI3ZTg3NjA3MmIzMzg5Yjc=
12
12
  data.tar.gz: !binary |-
13
- OWU2OGJiMmY2YzkyYjQzZDUyMTdmYzNlZDVmYzg3MzI2ZWIzNGU5NzM0Y2I0
14
- ZGRlNDZjMjhiMTE4YjM0MzY0ODBlOWM2ZWRlNWY3YmRlOGQ0ZWI4MzI5MDdk
15
- ZjVkMWZmYTdmODYxYWY5YWVjZmUzZTIxMDk2MzcwZTM5Mzk0MmE=
13
+ ZTZiYTg1MzQyOWVjMDUzMzQxOWQ4YzIzNTc3ZDhhOGY4ODBiOTg3ZDMwYjE4
14
+ ZDU1M2E5MWRiMjI0NGE2ODY0MWUxNWRiODU0NjdlZTBiODA3YzkwZWQ1OTYx
15
+ MDU5ZDcxYjBmNzAxYzM5YWNiZmM3YTEwMmM2Nzg4NjkzZWUxOTI=
@@ -4,7 +4,7 @@ require 'lookout/rack/test/cucumber'
4
4
 
5
5
  # Set up TestApp server
6
6
  require 'examples/test_app'
7
- $application_class = TestApp
7
+ Lookout::Rack::Test.app = TestApp
8
8
  require 'lookout/rack/test/cucumber/server'
9
9
 
10
10
  require 'lookout/rack/test/cucumber/transforms'
@@ -1,9 +1,13 @@
1
1
  require 'rack/test'
2
+ require 'lookout/rack/test'
2
3
 
3
4
  module Lookout::Rack::Test::Cucumber
4
5
  module Server
5
6
  def app
6
- @app ||= $application_class.new if $application_class
7
+ return @app if @app
8
+
9
+ klass = ::Lookout::Rack::Test.app || $application_class
10
+ @app = klass.new if klass
7
11
  end
8
12
  end
9
13
  end
@@ -7,10 +7,12 @@ require 'lookout/rack/test/cucumber/transforms'
7
7
  require 'lookout/rack/test/cucumber/general_steps'
8
8
  require 'lookout/rack/test/cucumber/before'
9
9
 
10
- require 'lookout/rack/test/cucumber/server' if $application_class
10
+ require 'lookout/rack/test/cucumber/server'
11
11
 
12
12
  module Lookout::Rack::Test
13
13
  module Cucumber
14
+ include Lookout::Rack::Test::Cucumber::Server
15
+
14
16
  def render_string(buffer, opts={})
15
17
  ::Liquid::Template.parse(buffer).render(template_vars.merge(opts))
16
18
  end
@@ -22,10 +24,6 @@ module Lookout::Rack::Test
22
24
  def current_locale
23
25
  I18n.locale = ENV['CUCUMBER_LOCALE'] || 'en'
24
26
  end
25
-
26
- def app
27
- @app ||= $application_class.new if $application_class
28
- end
29
27
  end
30
28
  end
31
29
 
@@ -1,7 +1,12 @@
1
+ require 'lookout/rack/test'
2
+
1
3
  module Lookout::Rack::Test::RSpec
2
4
  module RouteHelper
3
5
  def app
4
- @app ||= $application_class.new if $application_class
6
+ return @app if @app
7
+
8
+ klass = ::Lookout::Rack::Test.app || $application_class
9
+ @app = klass.new
5
10
  end
6
11
  end
7
12
  end
@@ -38,7 +38,7 @@ module Lookout
38
38
  c.include(::Rack::Test::Methods, :type => :route)
39
39
 
40
40
  require 'lookout/rack/test/rspec/route_helper'
41
- $application_class = application
41
+ ::Lookout::Rack::Test.app = application
42
42
  c.include(::RouteHelper, :type => :route)
43
43
  end
44
44
  end
@@ -1,7 +1,7 @@
1
1
  module Lookout
2
2
  module Rack
3
3
  module Test
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
6
6
  end
7
7
  end
@@ -3,6 +3,15 @@ require 'lookout/rack/test/version'
3
3
  module Lookout
4
4
  module Rack
5
5
  module Test
6
+ @@app = nil
7
+
8
+ def self.app=(application_class)
9
+ @@app = application_class
10
+ end
11
+
12
+ def self.app
13
+ @@app
14
+ end
6
15
  end
7
16
  end
8
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookout-rack-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Smith