Ad
  • Custom User Avatar

    I am translating a Kata into Ruby, and need to disable the use of certain operators. What is the best way to go about this?

  • Custom User Avatar

    It's not an issue for the kata but rather for CW and for you. I saw in your post below that you resolved your problem by running your code in a terminal. Do you run your code directly at CW? First thing to do: running your code in your machine; second: when you don't pass the tests look carefully at your program before thinking that there is something wrong in the tests. Think that in the last run of a loop the last white space could be too much.
    I consider the issue as resolved but you could send a bug report at CW in order that they better show white spaces.

  • Custom User Avatar

    @bkaes: good idea but a bit too late for current-next kata:-(

  • Custom User Avatar

    Found the issue. I had an extra space. The test output was condensing the white space, so 2 spaces appeared to be 1.
    I diagnosed the issue by running my code in the terminal with a "puts" statement.
    After correcting the white space, my code passed all tests.

  • Custom User Avatar

    Tests are too dependent on white space being correct.
    It is difficult to diagnose a white space issue because the test output apparently removes extra white space.

    Here is an example:

    #Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ; (test output: expected value)
    #Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ; (test output: actual value)
    #Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B  ; (actual value, when code run in terminal)
    

    In the above example, my code had an additional space before the semicolon, but the test output makes the actual and expected values appear identical.

  • Custom User Avatar

    That doesn't solve the underlying error. However, @JTorr needs to share her current solution. Maybe it's not the whitespace, but something else. Also, AFAIK, Jake needs an example in order to fix #55.

    Slightly off-topic: an array of objects would be much more idiomatic in JS (other languages have similar features), like

    [ {"type" : "Buy", "id" : "169850"}, { "type" : "Sell", "id" : "116000"} ]
    
  • Custom User Avatar

    What about putting something like "-" instead of whitespaces in the resulting string?

  • Custom User Avatar

    Ahem. You remember the discussion we just had over there on the other kata? :>. That's the other reason I don't like strings: You don't see whitespace errors in the output. One should probably file an issue (and I should add this drawback to the guide). Edit: It's already filed.

  • Custom User Avatar

    I can't see any difference! Which language? Did you try several times? CW seems to have too much to do.

  • Custom User Avatar

    My tests are failing even though the strings appear to match. I have even compared the string using the tool at http://www.textdiff.com/, and the strings show that they match.

    Here is the failure message:

    Expected: "Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ;", instead got: "Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ;"
    

    Here's the output again, lined up for easy comparison:

    Expected: "Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ;"
    Actual:   "Buy: 169850 Sell: 116000; Badly formed 1: CSCO 250.0 29 B ;"
    

    What am I missing?