Sha256: 4897d5b3c72edde0d0348fb2dd0f7465c50a06e5a58834debde94b5c245205a6

Contents?: true

Size: 1006 Bytes

Versions: 222

Compression:

Stored size: 1006 Bytes

Contents

require_relative '../../test_helper'

module Generator
  class ExerciseCase
    class CaseHelpersTest < Minitest::Test
      class MultiLineCase
        include CaseHelpers

        def workload
          indent_lines(['foo', 'bar'], 1)
        end
      end
      def test_indent_multiline_workloads
        expected = "foo\n bar"
        assert_equal expected, MultiLineCase.new.workload
      end

      class BlankLineCase
        include CaseHelpers

        def workload
          indent_text(2, "foo\n\nbar\n")
        end
      end
      def test_indent_multiline_workloads_with_blank_lines
        expected = "foo\n\n  bar\n"
        assert_equal expected, BlankLineCase.new.workload
      end

      class HeredocCase
        include CaseHelpers

        def workload
          indent_heredoc(["foo", "bar"], 'TEXT', 1)
        end
      end
      def test_heredoc
        expected = "<<-TEXT\n foo\n bar\nTEXT"
        assert_equal expected, HeredocCase.new.workload
      end
    end
  end
end

Version data entries

222 entries across 222 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.179 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.178 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.177 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.176 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.175 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.174 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.173 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.172 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.171 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.170 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.169 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.167 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.166 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.165 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.164 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.163 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.162 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.161 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.160 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb