search for: remove_constant

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

2007 Sep 10
2
Removing an AR class definition, for testing plugins
I''m writing an acts_as_* plugin and am trying to BDD it. Ideally my specs would look like: describe ActsAsCloneable, " basic cloning" do load_example_classes School.class_eval do acts_as_cloneable end before(:each) do @old_school = School.create! :name => "Baylake Pines", :city => "Virginia Beach", :guid => "abc123"
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
...allas 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-1.4.1/lib/active_support/dependencies.rb:273:in `remove_unloadable_constants!'' /usr/lib/ruby/gems/1.8/gems/a...
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
...rade. #<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!''", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:in `remove_unloadable_constants!...
2006 Mar 30
1
Logger::Format not defined (NameError) [NOOB]
I have just installed apache2 / php4 / mysql and RoR on a clean and minimal 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'':
2007 Apr 04
0
Webrick startup problem
...ies.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'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:368:in `new_constants_in'' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:368:in `each'' from c:/ruby/lib/ruby/gems/1.8/gems/actives...
2007 Mar 17
0
webrick failing with "NameError: cannot remove Object::UnknownPropertyMethod"
...endencies.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''" , "/usr/local/lib/ruby/gems/1.8/gems/ activesupport-1.4.2/lib/active_support/dependencies.rb:273:in `remove_unloa dable_constants!''", "/usr/local/lib/ruby/gems/ 1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb: 27 3:in `...
2006 Dec 08
4
Using custom stem analyzer giving mongrel errors
...t::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 `remove_unloadable_constants!'' /Users/raymond/Rails/cart/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:...
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
Hi, I am developing on Win XP at the moment for an NGO that seems stuck on the idea that Win2003 Server is the future. Much as I have tried to convert them to a unix environment, they''re having none of it. I am using the prebuilt Win32 release of ferret 0.10.9 and would like to upgrade to the latest version for the latest features etc but more importantly to solve an issue with bug
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
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 =
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
(Using the latest 3-0-stable and rvm, and ruby-1.9.2-p0) Yesterday everything worked, my own changes are very minor and in the application only. Did anything change that could have caused this problem? Unfortunately simply going back in rails alone to the original "RC2" git-tag did not immediately help, so it may be some other problem (on my own system only, even if I''m
2006 Mar 10
0
WEBrick crashing
ruby 1.8.2 (2004-12-25) [i386-mswin32] latest version of edge rails - patched to make the server work with win32 (http://dev.rubyonrails.org/ticket/4139) On some pages WEBrick is crashing with the following: d:/programming/ruby/lib/ruby/1.8/profiler.rb:27: You have a nil object when you didn''t expect it! (NoMethodError) You might have expected an instance of Array. The error occured
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 <