Sha256: d039c76e424ade9dffe2baeec3fee95b709e3beba413a83bf92bf56d241919ee

Contents?: true

Size: 559 Bytes

Versions: 33

Compression:

Stored size: 559 Bytes

Contents

describe Patch do
  context 'Models' do
    it 'defines all models' do
      constants.each do |constant|
        expect { Patch.const_get(constant) }.not_to raise_error
      end
    end
  end

  def constants
    # Given a file path return the constant of that path, for example:
    # 'lib/patch_ruby/models/project_response.rb' -> ProjectResponse
    Dir.glob("lib/patch_ruby/models/*.rb").map do |file|
      parsed_filename = file.split('/').last.split('.').first
      constant = parsed_filename.split('_').map(&:capitalize).join('')
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
patch_ruby-1.13.0 spec/patch_ruby_spec.rb
patch_ruby-1.12.0 spec/patch_ruby_spec.rb
patch_ruby-1.11.1 spec/patch_ruby_spec.rb
patch_ruby-1.11.0 spec/patch_ruby_spec.rb
patch_ruby-1.10.2 spec/patch_ruby_spec.rb
patch_ruby-1.10.1 spec/patch_ruby_spec.rb
patch_ruby-1.10.0 spec/patch_ruby_spec.rb
patch_ruby-1.9.0 spec/patch_ruby_spec.rb
patch_ruby-1.8.0 spec/patch_ruby_spec.rb
patch_ruby-1.7.0 spec/patch_ruby_spec.rb
patch_ruby-1.6.0 spec/patch_ruby_spec.rb
patch_ruby-1.5.2 spec/patch_ruby_spec.rb
patch_ruby-1.5.1 spec/patch_ruby_spec.rb