1. 30 Jul, 2019 2 commits
    • Yukihiro "Matz" Matsumoto's avatar
      Merge pull request #4606 from shuujii/refine-message-to-skip-in-nested-assert · 7dae0ec7
      Yukihiro "Matz" Matsumoto authored
      Refine message to `skip` in nested `assert`
      7dae0ec7
    • KOBAYASHI Shuji's avatar
      Refine message to `skip` in nested `assert` · 44381f0a
      KOBAYASHI Shuji authored
      - I think "Info" is used only to `skip`, so change to "Skip".
      - Changed the default value of `assert` and specify the argument explicitly
        at the caller of `assert` because it is unnatural "Assertion failed" is
        output even though the assertion doesn't fail.
      
      == Example:
      
        def assert_foo(exp, act)
          assert do
            assert_equal exp[0], act[0]
            assert_equal exp[1], act[1]
          end
        end
      
        def assert_bar(exp, act)
          assert do
            skip
          end
        end
      
        def assert_baz(exp, act)
          assert do
            assert_equal exp, act
            assert_bar exp, act
          end
        end
      
        assert 'test#skip_in_nested_assert' do
          assert_baz 1, 1
        end
      
        === Before this patch:
      
          ?..
          Info: test#skip_in_nested_assert (core)
           - Assertion[1]
              Info: Assertion failed (core)
               - Assertion[1-2]
                  Skip: Assertion failed (core)
            Total: 3
               OK: 2
               KO: 0
            Crash: 0
          Warning: 0
             Skip: 1
      
        === After this patch:
      
          ???
          Skip: test#skip_in_nested_assert (core)
           - Assertion[1]
              Skip: assert (core)
               - Assertion[1-2]
                  Skip: assert (core)
            Total: 3
               OK: 0
               KO: 0
            Crash: 0
          Warning: 0
             Skip: 3
      44381f0a
  2. 29 Jul, 2019 4 commits
  3. 28 Jul, 2019 10 commits
  4. 27 Jul, 2019 8 commits
  5. 26 Jul, 2019 1 commit
  6. 25 Jul, 2019 2 commits
  7. 24 Jul, 2019 4 commits
  8. 23 Jul, 2019 2 commits
    • Yukihiro "Matz" Matsumoto's avatar
      Merge pull request #4593 from shuujii/add-encoding-argument-to-Integral-chr · e968bdf6
      Yukihiro "Matz" Matsumoto authored
      Add encoding argument to `Integral#chr`
      e968bdf6
    • KOBAYASHI Shuji's avatar
      Add encoding argument to `Integral#chr` · e86aa61f
      KOBAYASHI Shuji authored
      Currently, `Integral#chr` in mruby changes behavior by `MRB_UTF8_STRING`
      setting.
      
      before this patch:
      
        $ bin/mruby -e 'p 171.chr'  #=> "\xab"  (`MRB_UTF8_STRING` is disabled)
        $ bin/mruby -e 'p 171.chr'  #=> "«"     (`MRB_UTF8_STRING` is enabled)
      
      This behavior is incompatible with Ruby, and a little inconvenient because
      it can't be interpreted as ASCII-8BIT with `MRB_UTF8_STRING`, I think.
      
      So add encoding argument according to Ruby.
      
      after this patch:
      
        $ bin/mruby -e 'p 171.chr'                #=> "\xab"
        $ bin/mruby -e 'p 171.chr("ASCII-8BIT")'  #=> "\xab"
        $ bin/mruby -e 'p 171.chr("UTF-8")'       #=> "«"
      
      Allow only `String` for encoding because mruby doesn't have `Encoding`
      class, and `"ASCII-8BIT"` (`"BINARY"`) and `"UTF-8"` (only with
      `MRB_UTF8_STRING`) are valid value (default is `"ASCII-8BIT"`).
      e86aa61f
  9. 22 Jul, 2019 7 commits