n Lazytest, you can use the context objects provided by
> lazytest.context.stub.
>
> -S
>
>
> On Oct 24, 3:03 pm, "Felix H. Dahlke" wrote:
> Hi Stuart,
>
> I just read through this thread again and noticed that I didn't notice
> you mentioning th
n using
> `binding` to stub out functions within your tests. Lazytest github.com/stuartsierra/lazytest> has explicit support for stubbing
> out functions during testing.
>
> -S
>
>
> On Oct 11, 6:06 pm, "Felix H. Dahlke" wrote:
>> Hi,
>>
>> I
d prov])
>
> ;; tests
> (def loader (loader-rec. :mock (prov-rec. nil nil nil)))
> (load-page loader "index.html")
> ;; real work
> (def loader (loader-rec. :db (prov-rec. "data" "user" "pwd")))
> (load-page loader "index.html")
>
fields) and use in function calls. And each
> method is a particular responsibility. That's how I think about it,
> anyway.
>
> Either choice should be fine. I write Java interfaces for
> implementations in Clojure when I want interop with Java, otherwise I
> use multimethods and d
bers /c /such that /a < c < b/. However, there do not
>> exist any numbers between 0.9... and 1, thus they must be same number.
>>
>> As it turns out, it took mathematicians a long time to nail down
>> formally exactly what we naively think of as "numbers".
On 13/10/10 22:28, David Sletten wrote:
>
> On Oct 12, 2010, at 5:44 PM, Brian Hurt wrote:
>
>> For example, in base 10, 1/3 * 3 = 0.9...
>
> It may seem counterintuitive, but that statement is perfectly true.
> 1 = 0....
>
> That's a good test of how well you understand infinity.
I see. So instead of using interfaces and implementations of these, I
would simply use closures, one for mock and one for production? That was
actually my first attempt, but I didn't like it back then.
Take this code for example - passing a function just to have it called
feels weird:
(defn load-
Nice rant, I learned something here :) I somehow thought BigDecimal
wouldn't have any precision issues, but I probably never noticed because
I can only think in base-10 arithmetic. Has been good enough for my
humble precision problems so far though, never had a notable performance
issue with it eit
Um, I meant BigDecimal, not BigInteger.
On 12/10/10 18:24, Felix H. Dahlke wrote:
> You could use BigInteger, which was created to work around double's
> rounding issues - among other things.
>
> (- 12.305M 12.3049M)
> 0.0001M
>
> On 12/10/10 18:17, cej38 wrote:
>&g
The posts and Midje looks pretty interesting, but I'm not sure if I was
able to follow, being new to Clojure. I'll give it another try later :)
Meanwhile, I've adjourned TDD in my project and wrote some code without
it to see if it makes more sense to me that way. I have to say that,
although I di
You could use BigInteger, which was created to work around double's
rounding issues - among other things.
(- 12.305M 12.3049M)
0.0001M
On 12/10/10 18:17, cej38 wrote:
> I keep running into this type of problem:
>
> user=> (- 12.305 12.3049)
> 9.9976694E-5
>
> The computer (probably the
Hi,
I'm new to Clojure, using it for a reasonably sized project for the
first time, and I'm trying to do test-driven development.
While it does work well technically - clojure.test is very nice to use
and feels a lot like JUnit 4's assertThat() - I'm wondering if I'm
trying to program Java in Cl
12 matches
Mail list logo