netzke / netzke-core

Framework for Sencha Ext JS + Ruby on Rails client-server components
http://netzke.org
Other
263 stars 77 forks source link

Fix unit tests #39

Closed avsej closed 12 years ago

avsej commented 12 years ago

Hi @nomadcoder

I'm trying to make unit tests running, and these patches done some things, but I stumbled upon the code I don't know how to fix, it might be something was changed in component implementation. Could you check out my fork (master branch) and try to run rake test?

Thanks

avsej commented 12 years ago

This is the output I've got

$ rake test
/home/avsej/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -I"lib:lib:test" -I"/home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib" "/home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/**/*_test.rb" 
Run options: --seed 34179

# Running tests:

.....F.EEE.EEEE.

Finished tests in 0.006973s, 2294.4854 tests/s, 3298.3228 assertions/s.

  1) Failure:
test_api(NetzkeCoreTest) [/home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:85]:
<[:deliver_component, :method_one, :method_two]> expected but was
<{:deliver_component=>{}, :method_one=>:method_two}>.

  2) Error:
test_class-level_configuration(NetzkeCoreTest):
ArgumentError: Config hash or block required
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/configuration.rb:32:in `config'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:9:in `config'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:152:in `block in <class:NetzkeCoreTest>'

  3) Error:
test_component_instance_by_config(NetzkeCoreTest):
NameError: uninitialized constant Component
    /home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:68:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:73:in `instance_by_config'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:139:in `block in <class:NetzkeCoreTest>'

  4) Error:
test_components(NetzkeCoreTest):
NameError: uninitialized constant NestedComponentOne
    /home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:68:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:103:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:149:in `block in component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:92:in `block in <class:NetzkeCoreTest>'

  5) Error:
test_dependencies_calculated(NetzkeCoreTest):
NoMethodError: undefined method `dependencies' for #<Netzke::Component:0x00000001e633f8>
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:127:in `block in <class:NetzkeCoreTest>'

  6) Error:
test_dependency_classes(NetzkeCoreTest):
NameError: uninitialized constant NestedComponentOne
    /home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:68:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:103:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:149:in `block in component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:165:in `block in dependency_classes'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:164:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:164:in `dependency_classes'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:135:in `block (2 levels) in <class:NetzkeCoreTest>'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:135:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:135:in `inject'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:135:in `block in <class:NetzkeCoreTest>'

  7) Error:
test_global_id_by_reference(NetzkeCoreTest):
NameError: uninitialized constant NestedComponentTwo
    /home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:68:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:103:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:149:in `block in component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:108:in `block in <class:NetzkeCoreTest>'

  8) Error:
test_js_inheritance(NetzkeCoreTest):
NameError: uninitialized constant NestedComponentOne
    /home/avsej/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'
    /home/avsej/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:68:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/base.rb:103:in `constantize_class_name'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:149:in `block in component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:140:in `component_instance'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:165:in `block in dependency_classes'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:164:in `each'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/composition.rb:164:in `dependency_classes'
    /home/avsej/code/netzke-experiments/netzke-core/lib/netzke/javascript.rb:359:in `js_missing_code'
    /home/avsej/code/netzke-experiments/netzke-core/test/unit/netzke_core_test.rb:146:in `block in <class:NetzkeCoreTest>'

16 tests, 23 assertions, 1 failures, 7 errors, 0 skips
rake aborted!
Command failed with status (1): [/home/avsej/.rvm/rubies/ruby-1.9.3-p194/bi...]

Tasks: TOP => test
(See full trace by running task with --trace)
mxgrn commented 12 years ago

Tests are running fine with rspec spec from inside core_test_app.