Sha256: 2772c402ec0aa829b7a4875fce238da9cf3b300097574cebb2da6269114476c9

Contents?: true

Size: 632 Bytes

Versions: 48

Compression:

Stored size: 632 Bytes

Contents

require 'ostruct'

module Generator
  class ExerciseCase
    using Generator::Underscore
    include CaseHelpers
    include Assertion

    attr_reader :canonical
    def initialize(canonical:)
      @canonical = canonical
    end

    def name
      'test_%s' % canonical.description.underscore
    end

    def skipped(index)
      index.zero? ? '# skip' : 'skip'
    end

    def method_missing(sym, *args, &block)
      return canonical.send(sym) if canonical.respond_to?(sym)
      super(sym, *args, &block)
    end

    def respond_to?(sym, include_private = false)
      canonical.respond_to?(sym) || super
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
trackler-2.2.1.10 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.9 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.8 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.7 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.6 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.5 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.4 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.3 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.2 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.1 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.1.0 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.6 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.5 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.4 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.3 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.2 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.1 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.2.0.0 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.1.0.55 tracks/ruby/lib/generator/exercise_case.rb
trackler-2.1.0.54 tracks/ruby/lib/generator/exercise_case.rb