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.78 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.77 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.76 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.75 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.74 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.73 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.72 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.71 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.70 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.69 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.68 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.67 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.66 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.65 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.64 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.63 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.62 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.61 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.60 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb
trackler-2.2.1.59 tracks/ruby/test/generator/exercise_case/case_helpers_test.rb