Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor rearrangement of stubbing to prevent problems with Rspec

  • Loading branch information...
commit 006d47899e3b287d5cf62538a467681abd58df89 1 parent ff902df
Dan Kubb authored
View
3  spec/unit/sql/postgresql_spec.rb
@@ -40,10 +40,10 @@ class PostgresqlExtension
@col1 = mock('SQLite3 Column')
@col2 = mock('SQLite3 Column')
- SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
end
it 'should initialize columns by querying the table' do
+ SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
@adapter.should_receive(:query_table).with('users').and_return([@cs1,@cs2])
SQL::Postgresql::Table.new(@adapter, 'users')
end
@@ -55,6 +55,7 @@ class PostgresqlExtension
end
it 'should set the @columns to the looked-up columns' do
+ SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
t = SQL::Postgresql::Table.new(@adapter, 'users')
t.columns.should == [@col1, @col2]
end
View
3  spec/unit/sql/sqlite3_extensions_spec.rb
@@ -50,10 +50,10 @@ class Sqlite3Extension
@col1 = mock('SQLite3 Column')
@col2 = mock('SQLite3 Column')
- SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
end
it 'should initialize columns by querying the table' do
+ SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
@adapter.should_receive(:query_table).with('users').and_return([@cs1,@cs2])
SQL::Sqlite3::Table.new(@adapter, 'users')
end
@@ -65,6 +65,7 @@ class Sqlite3Extension
end
it 'should set the @columns to the looked-up columns' do
+ SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
t = SQL::Sqlite3::Table.new(@adapter, 'users')
t.columns.should == [@col1, @col2]
end
Please sign in to comment.
Something went wrong with that request. Please try again.