search for: remove_const

Displaying 20 results from an estimated 24 matches for "remove_const".

2007 Sep 10
2
Removing an AR class definition, for testing plugins
...e classes. The undefs would go there too. Unfortunately what''s happening is that the definition from the second spec is being used for the first spec...so when running both specs, the first fails. However if I comment out the second spec, the first one passes. I''ve tried using remove_const and Object.remove_class. Neither seems to work. I need to start with a fresh class definition before each description is run...how can I do that? Pat
2007 Oct 28
4
A better way to stub out constants
Hi Something that''s gnawing at me... to avoid using the SQLite3 gem I''m stubbing 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:
2007 Nov 21
7
describe scope
Hi, Googling ''RSpec describe scope'' didn''t yield much, so apologies if this question has been dealt with. It seem well known that a ruby class is ''visible'' between describes, and if this is a problem then you should use some counter as prefix or suffix: ''class Item_001; ... end'' Is there any work underway, or sheduled release where
2007 Mar 10
2
upgrading rails to 1.2.2 giving me mongrel errors
...6716 I''m running Ubuntu with mongrel 1.0.1 and fastthread 0.6.4.1. I also get this on macosx Thanks! Dallas Error calling Dispatcher.dispatch #<NameError: cannot remove Object::USER_AGENT> /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:422:in `remove_const'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:422:in `remove_constant'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:273:in `remove_unloadable_constants!'' /usr/lib/ruby/gems/1.8/gems/activesupport-...
2007 Sep 21
3
Standardize environment between specs containing class defs
...ass Animal class Cod < Animal In this situation the second spec will fail since Cod was previously defined to be a subclass of Fish and you can not change the superclass of a subclass in ruby without causing an exception. I want the resetting to be as automatic as possible since calling remove_constant on every class my code defines after each spec is a real pain since this situation is going to crop up in lots of different specs and describe blocks. Thank you, Matt Margolis
2007 Jan 24
7
Ferret problems with Rails 1.2.1
...r I load a page that uses a class that uses ferret. I have ferret 0.10.13 and acts_as_ferret. They were working fine before the upgrade. #<NameError: cannot remove Object::WildcardQuery> ["/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:in `remove_const''", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:in `remove_constant''", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:in `remove_unloadable_constants!''&quot...
2006 Mar 30
1
Logger::Format not defined (NameError) [NOOB]
...al Ubuntu (5.10) server. I have set up a test site and can reach the "Welcome on board" index page. However when I run "ruby script/generate contoller firsttest" I get the following error. ./script/../config/../vendor/activesupport/lib/active_support/clean_logger.rb:13:in `remove_const'': constant Logger::Format not defined (NameError) from ./script/../config/../vendor/activesupport/lib/active_support/clean_logger.rb:13 from ./script/../config/../vendor/activesupport/lib/active_support.rb:31 from ./script/../config/environment.rb:50 from...
2007 Apr 04
0
Webrick startup problem
...other plugins. I am able to start the application of some applications. But for this application it is giving this error. Can some body help me................THANKS in advance. => Booting WEBrick... c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in `remove_const'': cannot remove Object::LogServer (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in `send'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in `remove_constant''...
2007 Mar 17
0
webrick failing with "NameError: cannot remove Object::UnknownPropertyMethod"
..._without_deprecation at / usr/local/lib/ruby/gems/1.8/gems/actionpack- 1.13.3/lib/action_controller/deprecated_dependencies.rb:13) #<NameError: cannot remove Object::UnknownPropertyMethod> ["/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/ active_support/dependencies.rb:422:in `remove_const'' ", "/usr/ local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/ dependencies.rb:422:in `send''", "/u sr/local/lib/ruby/gems/1.8/ gems/activesupport-1.4.2/lib/active_support/dependencies.rb:422:in `remove_constant''"...
2006 Dec 08
4
Using custom stem analyzer giving mongrel errors
...;. Here is the error produced in the Mongrel logs: Thu Dec 07 17:49:06 PST 2006: Error calling Dispatcher.dispatch #<NameError: cannot remove Object::QueryParser> /Users/raymond/Rails/cart/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:416:in `remove_const'' /Users/raymond/Rails/cart/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:416:in `remove_constant'' /Users/raymond/Rails/cart/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:270:in `remov...
2008 Jul 25
21
Problems with mock assigned to a constant
Hi all, Initially I thought this was a bug in the built-in mocking framework(and it still may be), but I better hash it out on the mailing list before I file/reopen the ticket: http://rspec.lighthouseapp.com/projects/5645/tickets/478-mocks-on-constants#ticket-478-6 I thought my example illustrated my problem, but obviously I was passing the wrong arguments to the mock. I revised my example to
2007 Feb 05
0
Any word on a recent build for Win32/Rails 1.2.1
...to be braking when ferret is required and included (well this is at least the case when using ferret from /script/runner). When I require and include ferret any bugs (even those unrelated to ferret) fail to be reported correctly with messages that start: ...active_support/dependencies.rb:423:in `remove_const'': cannot remove Object::<VARIOUS> (NameError) Where <VARIOUS> are things like QueryParser, Field etc. I have tried compiling ferret myself but I only have mingw installed and the ferret rails task seems to want to use nmake (MVC?). Thanks, Chad. -- Posted via http://www.ru...
2007 Apr 05
0
problem with script/plugin install
Whenever I try to install a plugin I get the following error: e:/apps/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/ active_support/dependencies.rb:422:in `remove_const'': cannot remove Object::OPT_TABLE (NameError) from e:/apps/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/ lib/active_support/dependencies.rb:422:in `send'' from e:/apps/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/ lib/active_support/dependencies.rb:422:in `re...
2014 Feb 22
0
Validates inclusion of include fails at plugin.
Hello, MyModel.rb, TYPES = { "type1" => 1 , "type2" => 2, "type3" => 3 }.freeze validates_inclusion_of :my_type, :in => TYPES.keys --------------------------------------- MyModelPatch.rb, base.send(:remove_const, :TYPES) base._validators[:my_type].reject!{ |validator| validator if validator.is_a? ActiveModel::Validations::InclusionValidator } TYPES = { "type1" => 1 , "type2" => 2, "type3" => 3,"type4" => 4, "type5" => 5 }.freeze base.const_s...
2006 Dec 26
7
Rubygems 0.9.0.8 and Fastthread problem
Heya Folks- This is mainly for Zed and Mentalguy. I have been playing with the new release of rubygems 0.9.0.8 and I have a major problem with the requirement that fastthread needs to be required before thread. Just requiring rubygems and then requiring fastthread right after that will throw the error: ez _blog $ ruby require ''rubygems'' require
2007 Jun 08
4
Mocha 0.5 released
* Hamcrest-style parameter matchers * Values returned and exceptions raised on consecutive invocations * Yields on consecutive invocations * Multiple yields on single invocation * Invocation dispatch fixed * Deprecated returning result of a Proc -- James. http://blog.floehopper.org
2007 Oct 25
3
Mocking Workers in Backgroundrb
Hi Has anyone mocked a call like the following for backgroundrb? MiddleMan.new_worker(:class => :admin_email_worker, :args => params [:email]) I cannot seem to find the correct manner to do it. Would have liked to be able to do MiddleMan.should_receive (:new_worker).with(:class => :admin_email_worker, :args => {"body" => "my message"}) Cheers Shane
2010 Aug 26
2
Today: constant JSON::Parser not defined
...ften, maybe). mha@ubuntu-vm:~/Letexa$ rails server => Booting WEBrick => Rails 3.0.0.rc2 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting /home/mha/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/json/common.rb: 27:in `remove_const'': constant JSON::Parser not defined (NameError) from /home/mha/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/json/ common.rb:27:in `parser='' from /home/mha/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/json/ext.rb: 10:in `<module:Ext>'' from /home/mha/.rvm/rubies/ruby-1.9.2...
2006 Mar 10
0
WEBrick crashing
...0.00 0.00 String#split 0.00 6.55 0.00 1 0.00 0.00 WEBrick::SimpleServer#star t 0.00 6.55 0.00 1 0.00 0.00 #<ActionController::Routin g::RouteSet:0x2c86d30>.recognize_path 0.00 6.55 0.00 2 0.00 0.00 Module#remove_const 0.00 6.55 0.00 1 0.00 16.00 User#subclasses 0.00 6.55 0.00 1 0.00 0.00 Dependencies.require_or_lo ad 0.00 6.55 0.00 1 0.00 0.00 Module#instance_methods 0.00 6.55 0.00 2 0.00 0.00 Module#na...
2006 Feb 03
4
(BUG in svn/trunk?) - superclass mismatch for any subclass of ApplicationController
I track svn/trunk of Rails using svn:externals Some change to Rails committed in the last 1-2 days broke my subclass of ApplicationController The example, below, works with Rails 1.0, but in today''s svn, it dies with the following error: "superclass mismatch for class FooController" class ApplicationController < ActionController::Base end class FooController <