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.98 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.97 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.96 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.95 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.94 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.93 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.92 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.91 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.90 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.89 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.88 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.87 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.86 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.85 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.84 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.83 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.82 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.81 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.80 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.79 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb