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-2.3.0 spec/patch_ruby_spec.rb
patch_ruby-2.1.1 spec/patch_ruby_spec.rb
patch_ruby-2.0.0 spec/patch_ruby_spec.rb
patch_ruby-1.24.2 spec/patch_ruby_spec.rb
patch_ruby-1.24.1 spec/patch_ruby_spec.rb
patch_ruby-1.24.0 spec/patch_ruby_spec.rb
patch_ruby-1.23.0 spec/patch_ruby_spec.rb
patch_ruby-1.22.0 spec/patch_ruby_spec.rb
patch_ruby-1.21.0 spec/patch_ruby_spec.rb
patch_ruby-1.20.0 spec/patch_ruby_spec.rb
patch_ruby-1.19.0 spec/patch_ruby_spec.rb
patch_ruby-1.18.0 spec/patch_ruby_spec.rb
patch_ruby-1.17.1 spec/patch_ruby_spec.rb
patch_ruby-1.17.0 spec/patch_ruby_spec.rb
patch_ruby-1.16.1 spec/patch_ruby_spec.rb
patch_ruby-1.16.0 spec/patch_ruby_spec.rb
patch_ruby-1.15.2 spec/patch_ruby_spec.rb
patch_ruby-1.15.1 spec/patch_ruby_spec.rb
patch_ruby-1.15.0 spec/patch_ruby_spec.rb
patch_ruby-1.14.0 spec/patch_ruby_spec.rb