Skip to content

Commit

Permalink
Splits up schema dumper range specs
Browse files Browse the repository at this point in the history
  • Loading branch information
danmcclain committed Jun 14, 2013
1 parent d3a96c5 commit 69a5d04
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 89 deletions.
89 changes: 0 additions & 89 deletions spec/schema_dumper/range_spec.rb

This file was deleted.

18 changes: 18 additions & 0 deletions spec/schema_dumper/ranges/daterange_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe 'daterange schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }

it 'correctly generates daterange column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.daterange :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.daterange "range"/
end
end
18 changes: 18 additions & 0 deletions spec/schema_dumper/ranges/int4range_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe 'intrange schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }

it 'correctly generates int4range column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.int4range :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.int4range "range"/
end
end
18 changes: 18 additions & 0 deletions spec/schema_dumper/ranges/int8range_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe 'int8range schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }

it 'correctly generates int8range column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.int8range :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.int8range "range"/
end
end
18 changes: 18 additions & 0 deletions spec/schema_dumper/ranges/numrange_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe 'numrange schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }

it 'correctly generates numrange column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.numrange :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.numrange "range"/
end
end
18 changes: 18 additions & 0 deletions spec/schema_dumper/ranges/tsrange_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe 'tsrange schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }

it 'correctly generates tsrange column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.tsrange :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.tsrange "range"/
end
end
17 changes: 17 additions & 0 deletions spec/schema_dumper/ranges/tstzrange_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'spec_helper'

describe 'tstzrange schema dump' do
let!(:connection) { ActiveRecord::Base.connection }
after { connection.drop_table :testings }
it 'correctly generates tstzrange column statements' do
stream = StringIO.new
connection.create_table :testings do |t|
t.tstzrange :range
end

ActiveRecord::SchemaDumper.dump(connection, stream)
output = stream.string

output.should match /t\.tstzrange "range"/
end
end

0 comments on commit 69a5d04

Please sign in to comment.