Correctly managing context in Ruby mixins -


there must simple here, i'm missing it.

i have module called genotyping, class called genotype:

module genotyping    class genotype 

and have unit testing class i'm trying work module:

require "test/unit" require "../genotyping.rb"  include genotyping  class testgenotyping < test::unit::testcase    def test_genotype     geno = genotyping::genotype.new 

and when running unit test file is:

  2) error: test_genotype(testgenotyping): nameerror: uninitialized constant genotyping::genotype 

if remove genotyping:: qualifer, naturally enough get:

      1) error: test_breeding_scenario(testgenotyping): nameerror: uninitialized constant testgenotyping::genotype 

i've taken hard around, , can't tell i'm doing wrong.

found it. 1 of module classes not closed, leading sorts of problems scope.

basically typo, though hard spot. thanks, all.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -