Permalink
Browse files

Forgot cons

  • Loading branch information...
1 parent 9df8acd commit 7e24cdd92ce25250fde95b21bbe7b7e8e4aaef5f @daveray committed Oct 15, 2011
Showing with 4 additions and 1 deletion.
  1. +2 −1 lib/familiar.rb
  2. +2 −0 test/test_familiar.rb
View
@@ -58,7 +58,8 @@ def self.method_missing(meth, *args, &block)
Java::ClojureLang::Atom,
Java::ClojureLang::Ref,
Java::ClojureLang::Agent,
- Java::ClojureLang::Var
+ Java::ClojureLang::Var,
+ Java::ClojureLang::Cons
].each do |x|
x.class_eval do
def to_s
View
@@ -25,6 +25,7 @@ def test_to_s_looks_right
assert Familiar.ref('hi').to_s =~ /^clojure\.lang\.Ref@\h+$/
assert Familiar.agent('hi').to_s =~ /^clojure\.lang\.Agent@\h+$/
assert Familiar.vars.identity.to_s =~ /^#'clojure\.core\/identity$/
+ assert_equal '(1 2 3)', Familiar.cons(1, Familiar.list(2, 3)).to_s
end
def test_inspect_looks_right
@@ -39,6 +40,7 @@ def test_inspect_looks_right
assert Familiar.ref('hi').inspect =~ /^#<Ref@\h+: "hi">$/
assert Familiar.agent('hi').inspect =~ /^#<Agent@\h+: "hi">$/
assert Familiar.vars.identity.inspect =~ /^#'clojure\.core\/identity$/
+ assert_equal '(1 2 3)', Familiar.cons(1, Familiar.list(2, 3)).inspect
end
def test_can_create_a_function_from_a_lambda

0 comments on commit 7e24cdd

Please sign in to comment.