public
Rubygem
Description: DataMapper - Core
Homepage: http://datamapper.org
Clone URL: git://github.com/sam/dm-core.git
Separated the mocked PostgresAdapter specs from the non-mocked by creating 
a unit test for PostgresAdapter.
Martin Kihlgren (author)
Wed May 14 06:30:46 -0700 2008
commit  3c01f8e8e60ca7c74a146bbef511c24063c49537
tree    12cde6320b07ccaef6a53c742186c5b738911e8c
parent  867d3116ff12b43f3569aaf61fc66bfdab02efbf
...
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
30
31
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
34
35
0
@@ -30,37 +30,6 @@ if HAS_POSTGRES
0
         Sputnik.auto_upgrade!(:postgres)
0
         @adapter.column_exists?("sputniks", "new_prop").should == true
0
       end
0
- it "#upgrade_model_storage should create sequences and then call super" do
0
- @adapter.should_receive(:create_connection).at_least(1).times.and_return(@connection)
0
- @connection.should_receive(:close).at_least(1).times
0
- @adapter.should_receive(:exists?).at_least(1).times.with("sputniks").and_return(true)
0
- @adapter.should_receive(:column_exists?).at_least(1).times.with("sputniks", "id").and_return(false)
0
- @adapter.should_receive(:column_exists?).at_least(1).times.with("sputniks", "name").and_return(false)
0
- @adapter.should_receive(:create_sequence_column).at_least(1).times.with(@connection, Sputnik, Sputnik.properties(:default)[:id])
0
- @command.should_receive(:execute_non_query).any_number_of_times.and_return(@result)
0
- @result.should_receive(:to_i).any_number_of_times.and_return(1)
0
- @connection.should_receive(:create_command).once.with("ALTER TABLE \"sputniks\" ADD COLUMN \"id\" INT4 NOT NULL DEFAULT nextval('sputniks_id_seq') NOT NULL").and_return(@command)
0
- @connection.should_receive(:create_command).once.with("ALTER TABLE \"sputniks\" ADD COLUMN \"name\" TEXT").and_return(@command)
0
- @adapter.upgrade_model_storage(nil, Sputnik).should == [Sputnik.properties(:default)[:id], Sputnik.properties(:default)[:name]]
0
- end
0
- it "#create_model_storage should create sequences and then call super" do
0
- @adapter.should_receive(:create_connection).at_least(1).times.and_return(@connection)
0
- @connection.should_receive(:close).at_least(1).times
0
- @adapter.should_receive(:create_sequence_column).at_least(1).times.with(@connection, Sputnik, Sputnik.properties(:default)[:id])
0
- @command.should_receive(:execute_non_query).any_number_of_times.with(any_args()).and_return(@result)
0
- @result.should_receive(:to_i).any_number_of_times.and_return(1)
0
- @connection.should_receive(:create_command).once.with("CREATE TABLE \"sputniks\" (\"id\" INT4 NOT NULL DEFAULT nextval('sputniks_id_seq') NOT NULL, \"name\" TEXT, PRIMARY KEY(\"id\"))").and_return(@command)
0
- @adapter.create_model_storage(nil, Sputnik)
0
- end
0
- it "#destroy_model_storage should drop sequences and then call super" do
0
- @adapter.should_receive(:create_connection).at_least(1).times.and_return(@connection)
0
- @connection.should_receive(:close).at_least(1).times
0
- @adapter.should_receive(:drop_sequence_column).at_least(1).times.with(@connection, Sputnik, Sputnik.properties(:default)[:id])
0
- @command.should_receive(:execute_non_query).any_number_of_times.with(any_args()).and_return(@result)
0
- @result.should_receive(:to_i).any_number_of_times.and_return(1)
0
- @connection.should_receive(:create_command).once.with("DROP TABLE IF EXISTS \"sputniks\"").and_return(@command)
0
- @adapter.destroy_model_storage(nil, Sputnik)
0
- end
0
     end
0
 
0
     describe "querying metadata" do

Comments

    No one has commented yet.