sequel_transaction 0.0.4 → 0.1.0

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: a9c776fd06d56bd99a1bdbe1a73434c603d67e4a
4
- data.tar.gz: 1b14b80e05aad90d9d584151dfc3528b2fd17cb6
3
+ metadata.gz: 291725d79047d1a1f4c80c0656bc5bb2fea694fb
4
+ data.tar.gz: 3c1b86850814c5b9b94c65be0e43948a3fc5e170
5
5
  SHA512:
6
- metadata.gz: 4cd93a7bfc278e6e75885b2f3dc25f973352d4011a37175f2fc6c538e7ea88c633b9ac56abbfa1004059dfa0779b5d352d0107e527e203bdbde698d1f914a636
7
- data.tar.gz: cdcdd332c5af6296a2c130578453f4620cbe90ae4d2f3de133986dad1460268d22c17cb7889cbf52ab10762af0d90d4781ab7c2a562283670285444f17f451ed
6
+ metadata.gz: 75a01655c78712c1b25e8d6b6e49c303bc99d821b7cb52497b9aa4931678b3967202f0d69128c7cc549e254b3cbca6f751be5e187f52fe64b35ed6c4bd3dfbf8
7
+ data.tar.gz: 7125283eb1c2ebae2c89a5d2a6a24bd92eff9f5c633921c52fa30de33bea0010d50bf94442e494677bda49541645b5e05c1e131abd242995bdee2fd49011fd6d
data/Rakefile CHANGED
@@ -2,7 +2,6 @@ require "bundler/gem_tasks"
2
2
  require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new do |t|
5
- puts ENV['TERM']
6
- t.libs = ['spec', 'lib']
7
- t.pattern = 'spec/**/*_spec.rb'
5
+ t.libs = ['spec', 'lib']
6
+ t.pattern = 'spec/**/*_spec.rb'
8
7
  end
@@ -10,6 +10,7 @@ module Rack
10
10
  if req.get? || req.head? || req.options?
11
11
  result = @inner.call env
12
12
  else
13
+ env['transaction.connection'] = @connection
13
14
  @connection.transaction do
14
15
  result = @inner.call env
15
16
  response = Response.new [], result[0]
@@ -1,3 +1,3 @@
1
1
  module SequelTransaction
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -63,6 +63,12 @@ describe Rack::SequelTransaction do
63
63
  dataset.must_be :empty?
64
64
  end
65
65
 
66
+ it 'adds connection to env' do
67
+ expect_call 200
68
+ subject.call env
69
+ env['transaction.connection'].must_equal connection
70
+ end
71
+
66
72
  %w{ GET HEAD OPTIONS }.each do |method|
67
73
  # shouldn't be modifying anything on these types of requests; modifying for assertion purposes
68
74
 
@@ -87,6 +93,12 @@ describe Rack::SequelTransaction do
87
93
  subject.call env
88
94
  dataset.wont_be :empty?
89
95
  end
96
+
97
+ it 'wont set connection on env' do
98
+ expect_call 200
99
+ subject.call env
100
+ env['transaction.connection'].must_be_nil
101
+ end
90
102
  end
91
103
  end
92
104
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_transaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vyrak.bunleang@gmail.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel