rack-lti 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 277e9014df9050362c2e13d446193138204f4938
4
- data.tar.gz: 8d0074eb73c29330d8fe0641fb9a16766c2b94c6
3
+ metadata.gz: fb5033988f314beec36f2ec28a42b36e90771687
4
+ data.tar.gz: 99c197e05ab5d504c5162b298b52851b953344a7
5
5
  SHA512:
6
- metadata.gz: 93e6f3179d41671d631a8238814220fefd789abb2814801dfcc580aeab170794d3bdfed0e1a044de11b3f09d7b24e04689c0d3964f4fcdd6e9f67c49b80f693e
7
- data.tar.gz: 37a52e7d3499561ef840020ad1093a3910b0812dfcf233172b82d8b5a03c5f20521472b06c6780181b1e72dcb4ba233f8755e1dd35425b4b6c6a174ec178d307
6
+ metadata.gz: 7c6d14c8b63847b9f10844ecb371f9518e786e39a7079638c4fd120639bcde24d66dcd30eef5e7de03e1088edc4d1bace15229e3aeaf9e0d175fb86943dff73b
7
+ data.tar.gz: 5c136b52efd1d4301c0cfd038e348e32d10af591db4d5479017c31cf0f41fd0fcee826ec2c7b3be441b192ac16914c0cd66710bceb1ed0016a4461738e2c2c43
@@ -61,8 +61,8 @@ module Rack::LTI
61
61
  end
62
62
 
63
63
  def valid_nonce?(nonce)
64
- if @config.nonce_validator.respond_to?(:call)
65
- @config.nonce_validator.call(nonce)
64
+ if @config[:nonce_validator].respond_to?(:call)
65
+ @config.nonce_validator(nonce)
66
66
  else
67
67
  @config.nonce_validator
68
68
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module LTI
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -57,8 +57,19 @@ class MiddlewareTest < Minitest::Unit::TestCase
57
57
  end
58
58
  end
59
59
 
60
+ def test_call_passes_the_nonce_to_the_given_proc
61
+ assertion = MiniTest::Mock.new
62
+ assertion.expect(:call, true)
63
+ @lti_app.config.nonce_validator = ->(nonce) { assertion.call }
64
+
65
+ @lti_app.stub(:valid_request?, true) do
66
+ @lti_app.call(Rack::MockRequest.env_for('/lti/launch'))
67
+ assertion.verify
68
+ end
69
+ end
70
+
60
71
  def test_call_returns_403_on_invalid_nonce
61
- @lti_app.config.nonce_validator ->(nonce) { false }
72
+ @lti_app.config.nonce_validator = ->(nonce) { false }
62
73
 
63
74
  @lti_app.stub(:valid_request?, true) do
64
75
  response = @lti_app.call(Rack::MockRequest.env_for('/lti/launch'))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-lti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Pendleton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-16 00:00:00.000000000 Z
11
+ date: 2013-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler