hyperion-mysql 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/spec/hyperion/mysql_spec.rb +31 -0
  2. metadata +4 -4
@@ -23,10 +23,39 @@ describe Hyperion::Mysql do
23
23
  QUERY
24
24
  end
25
25
 
26
+ def create_foreign_key_test_tables
27
+ execute <<-QUERY
28
+ CREATE TABLE account (
29
+ id INTEGER NOT NULL AUTO_INCREMENT,
30
+ first_name VARCHAR(35),
31
+ inti INTEGER,
32
+ data VARCHAR(32),
33
+ PRIMARY KEY (id)
34
+ );
35
+ QUERY
36
+ execute <<-QUERY
37
+ CREATE TABLE shirt (
38
+ id INTEGER NOT NULL AUTO_INCREMENT,
39
+ account_key INTEGER NOT NULL,
40
+ first_name VARCHAR(35),
41
+ inti INTEGER,
42
+ data VARCHAR(32),
43
+ PRIMARY KEY (id),
44
+ INDEX (account_key),
45
+ FOREIGN KEY (account_key) REFERENCES account (id)
46
+ );
47
+ QUERY
48
+ end
49
+
26
50
  def drop_table(table_name)
27
51
  execute "DROP TABLE IF EXISTS #{table_name};"
28
52
  end
29
53
 
54
+ def drop_foreign_key_test_tables
55
+ drop_table(:shirt)
56
+ drop_table(:account)
57
+ end
58
+
30
59
  TABLES = ['testing', 'other_testing']
31
60
 
32
61
  around :each do |example|
@@ -38,12 +67,14 @@ describe Hyperion::Mysql do
38
67
  before :each do |example|
39
68
  Hyperion::Sql.with_connection(CONNECTION_URL) do
40
69
  TABLES.each { |table| create_table(table) }
70
+ create_foreign_key_test_tables
41
71
  end
42
72
  end
43
73
 
44
74
  after :each do |example|
45
75
  Hyperion::Sql.with_connection(CONNECTION_URL) do
46
76
  TABLES.each { |table| drop_table(table) }
77
+ drop_foreign_key_test_tables
47
78
  end
48
79
  end
49
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperion-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-17 00:00:00.000000000 Z
12
+ date: 2012-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: 0.1.0
37
+ version: 0.1.1
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 0.1.0
45
+ version: 0.1.1
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: do_mysql
48
48
  requirement: !ruby/object:Gem::Requirement