To make our code-base testable we need special mind-set, with testability
in mind. It does not matter weather we test it right now or not, as far as
we can not predict future (we might at some pint switch from ERB to smth
else) - we need to make architecture consistent.
That is: separate object graph creation from actual work being done by
objects. And make each one's dependency explicit.
Using static dependency does not fit either of those to principles.


On Thu, Feb 27, 2014 at 11:05 AM, Lee moon soo <notifications@github.com>wrote:

> In
> zeppelin-zengine/src/main/java/com/nflabs/zeppelin/zengine/ERBEvaluator.java:
>
> > +import javax.script.ScriptContext;
> > +import javax.script.ScriptEngine;
> > +import javax.script.ScriptException;
> > +
> > +import org.apache.commons.lang.StringEscapeUtils;
> > +import org.apache.log4j.Logger;
> > +
> > +import com.sun.script.jruby.JRubyScriptEngineFactory;
> > +
> > +public class ERBEvaluator {
> > +	Logger logger = Logger.getLogger(ERBEvaluator.class);
> > +	Map<String, Object> localVariables = new HashMap<String, Object>();
> > +	
> > +	private static ScriptEngine rubyScriptEngine;
> > +	static {
> > +		JRubyScriptEngineFactory factory = new JRubyScriptEngineFactory();
>
> Do we really need create mock RubyScriptEngine implementation for testing?
> We can still test actual RubyScriptEngine implementation for testing, and
> that's currently provided by static initializer. I still don't get.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/NFLabs/zeppelin/pull/58/files#r10109729>
> .
>



-- 
--
Kind regards,
Alexander.