Permalink
Browse files

Minor rearrangement of stubbing to prevent problems with Rspec

  • Loading branch information...
1 parent ff902df commit 006d47899e3b287d5cf62538a467681abd58df89 Dan Kubb committed Nov 18, 2008
Showing with 4 additions and 2 deletions.
  1. +2 −1 spec/unit/sql/postgresql_spec.rb
  2. +2 −1 spec/unit/sql/sqlite3_extensions_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
@@ -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

0 comments on commit 006d478

Please sign in to comment.