dm-transactions 1.1.0.rc2 → 1.1.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
5
5
  SOURCE = ENV.fetch('SOURCE', :git).to_sym
6
6
  REPO_POSTFIX = SOURCE == :path ? '' : '.git'
7
7
  DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
8
- DM_VERSION = '~> 1.1.0.rc2'
8
+ DM_VERSION = '~> 1.1.0.rc3'
9
9
  DO_VERSION = '~> 0.10.2'
10
10
  DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
11
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0.rc2
1
+ 1.1.0.rc3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dm-transactions}
8
- s.version = "1.1.0.rc2"
8
+ s.version = "1.1.0.rc3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dirkjan Bussink (dbussink)", "Dan Kubb (dkubb)"]
12
- s.date = %q{2011-03-01}
12
+ s.date = %q{2011-03-10}
13
13
  s.description = %q{Makes transaction support available for adapters that support them}
14
14
  s.email = %q{gamsnjaga@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
  s.homepage = %q{http://github.com/datamapper/dm-transactions}
46
46
  s.require_paths = ["lib"]
47
47
  s.rubyforge_project = %q{datamapper}
48
- s.rubygems_version = %q{1.5.2}
48
+ s.rubygems_version = %q{1.6.2}
49
49
  s.summary = %q{Adds transaction support to datamapper}
50
50
  s.test_files = [
51
51
  "spec/isolated/require_after_setup_spec.rb",
@@ -59,18 +59,18 @@ Gem::Specification.new do |s|
59
59
  s.specification_version = 3
60
60
 
61
61
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
- s.add_runtime_dependency(%q<dm-core>, ["~> 1.1.0.rc2"])
62
+ s.add_runtime_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
63
63
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
64
64
  s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
65
65
  s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
66
66
  else
67
- s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc2"])
67
+ s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
68
68
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
69
69
  s.add_dependency(%q<rake>, ["~> 0.8.7"])
70
70
  s.add_dependency(%q<rspec>, ["~> 1.3.1"])
71
71
  end
72
72
  else
73
- s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc2"])
73
+ s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
74
74
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
75
75
  s.add_dependency(%q<rake>, ["~> 0.8.7"])
76
76
  s.add_dependency(%q<rspec>, ["~> 1.3.1"])
@@ -102,6 +102,40 @@ describe DataMapper::Resource, 'Transactions' do
102
102
  end
103
103
  end
104
104
 
105
+ supported_by :postgres, :mysql do
106
+ before do
107
+ @user_model.destroy!
108
+ end
109
+
110
+ it 'should support nested transactions' do
111
+ # can't assume dm-aggregates
112
+ begin
113
+ @user_model.all.length.should == 0
114
+
115
+ @user_model.transaction do # txn 1
116
+ @user_model.create(:name => 'jpr5')
117
+
118
+ @user_model.all.length.should == 1
119
+
120
+ begin
121
+ @user_model.transaction do # savepoint 1
122
+ @user_model.create(:name => 'dkubb')
123
+ @user_model.all.length.should == 2
124
+
125
+ raise
126
+ end
127
+ rescue => e
128
+ @user_model.all.length.should == 1
129
+ end
130
+
131
+ raise
132
+ end
133
+ rescue => e
134
+ @user_model.all.length.should == 0
135
+ end
136
+ end
137
+ end
138
+
105
139
  supported_by :postgres, :mysql, :sqlite, :oracle, :sqlserver do
106
140
  before do
107
141
  @user_model.destroy!
@@ -127,7 +161,7 @@ describe DataMapper::Resource, 'Transactions' do
127
161
  end
128
162
  end
129
163
 
130
- it 'should rollback when an error is thrown in a transaction' do
164
+ it 'should rollback when an error is raised in a transaction' do
131
165
  @user_model.all.size.should == 0
132
166
  lambda {
133
167
  @user_model.transaction do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dm-transactions
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 1.1.0.rc2
5
+ version: 1.1.0.rc3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dirkjan Bussink (dbussink)
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-03-01 00:00:00 -08:00
14
+ date: 2011-03-10 00:00:00 -08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: 1.1.0.rc2
24
+ version: 1.1.0.rc3
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: *id001
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements: []
117
117
 
118
118
  rubyforge_project: datamapper
119
- rubygems_version: 1.5.2
119
+ rubygems_version: 1.6.2
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: Adds transaction support to datamapper