search for: sqlite_connection_spec

Displaying 1 result from an estimated 1 matches for "sqlite_connection_spec".

2007 Oct 28
4
A better way to stub out constants
...g it out like this: before(:each) do @database = mock("SQLite3 database") SQLite3 = Module.new SQLite3::Database = Class.new SQLite3::Database.stub!(:new).and_return(@database) end But then it keeps nagging me: /spec/celestial/engine/connections/sqlite_connection_spec.rb:14: warning: already initialized constant SQLite3 Is this the best way to handle simulating a gem? One thought I had would be to have a section of code that loads the gem and passes the SQLite3 class in as a variable (more functional style rather than using global constants). Is this...