raml-rb 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -0
- data/README.md +4 -0
- data/lib/raml/method.rb +4 -11
- data/lib/raml/parser/method.rb +9 -0
- data/lib/raml/resource.rb +3 -3
- data/lib/raml/response.rb +2 -6
- data/lib/raml/version.rb +1 -1
- data/raml-rb.gemspec +1 -0
- data/spec/lib/core_ext/hash_spec.rb +4 -4
- data/spec/lib/raml/body_spec.rb +3 -3
- data/spec/lib/raml/documentation_spec.rb +2 -2
- data/spec/lib/raml/method_spec.rb +1 -1
- data/spec/lib/raml/parser/body_spec.rb +2 -2
- data/spec/lib/raml/parser/documentation_spec.rb +1 -1
- data/spec/lib/raml/parser/method_spec.rb +5 -4
- data/spec/lib/raml/parser/query_parameter_spec.rb +2 -2
- data/spec/lib/raml/parser/resource_spec.rb +3 -3
- data/spec/lib/raml/parser/response_spec.rb +3 -3
- data/spec/lib/raml/parser/root_spec.rb +1 -1
- data/spec/lib/raml/parser.rb +8 -8
- data/spec/lib/raml/query_parameter_spec.rb +5 -5
- data/spec/lib/raml/resource_spec.rb +4 -4
- data/spec/lib/raml/response_spec.rb +2 -2
- data/spec/lib/raml/root_spec.rb +5 -5
- data/spec/spec_helper.rb +3 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c44a61b3f805693e8bc4994c6771ca252c61a09
|
4
|
+
data.tar.gz: 7200d3ec09326ea04ce66a7fe6b9fbe7a3ba7d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 321e25ebe08ddd874f3f0609e2e5cf1dccc8ad040c637e8d23c436ccecb6777e91dd442c73f890111512f31bdf5b9dc79bb10ece296a8057411136fb9f0158ac
|
7
|
+
data.tar.gz: 1d85ab83f1914cf92abca3226edfa1dbdc9442571823b551f220355a7175f32338212d5fe46a7d4bc34f6c40c5cd29c5f2d92e1640247c78d7f84bafb2b75a76
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# raml-rb
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/jpb/raml-rb.svg?branch=master)](https://travis-ci.org/jpb/raml-rb) [![Coverage Status](https://coveralls.io/repos/github/jpb/raml-rb/badge.svg?branch=master)](https://coveralls.io/github/jpb/raml-rb?branch=master)
|
4
|
+
|
3
5
|
A RAML parser, implemented in Ruby.
|
4
6
|
|
7
|
+
[![Code Climate](https://codeclimate.com/github/jpb/raml-rb/badges/gpa.svg)](https://codeclimate.com/github/jpb/raml-rb)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
```
|
data/lib/raml/method.rb
CHANGED
@@ -1,28 +1,21 @@
|
|
1
1
|
module Raml
|
2
2
|
class Method
|
3
3
|
|
4
|
-
attr_accessor :method, :description, :headers, :responses, :query_parameters
|
4
|
+
attr_accessor :method, :description, :headers, :responses, :query_parameters, :bodies
|
5
5
|
|
6
6
|
def initialize(method)
|
7
7
|
@method = method
|
8
8
|
@responses = []
|
9
9
|
@query_parameters = []
|
10
|
+
@bodies = []
|
10
11
|
end
|
11
12
|
|
12
13
|
def response_codes
|
13
|
-
|
14
|
-
responses.each do |response|
|
15
|
-
codes << response.code
|
16
|
-
end
|
17
|
-
end
|
14
|
+
responses.map {|responses| response.code }
|
18
15
|
end
|
19
16
|
|
20
17
|
def content_types
|
21
|
-
|
22
|
-
responses.each do |response|
|
23
|
-
types << response.content_types
|
24
|
-
end
|
25
|
-
end.flatten.uniq
|
18
|
+
responses.map {|response| response.content_type }.flatten.uniq
|
26
19
|
end
|
27
20
|
|
28
21
|
end
|
data/lib/raml/parser/method.rb
CHANGED
@@ -3,6 +3,7 @@ require 'core_ext/hash'
|
|
3
3
|
require 'raml/method'
|
4
4
|
require 'raml/parser/response'
|
5
5
|
require 'raml/parser/query_parameter'
|
6
|
+
require 'raml/parser/body'
|
6
7
|
require 'raml/parser/util'
|
7
8
|
require 'raml/errors/unknown_attribute_error'
|
8
9
|
|
@@ -43,6 +44,8 @@ module Raml
|
|
43
44
|
parse_responses(value)
|
44
45
|
when 'query_parameters'
|
45
46
|
parse_query_parameters(value)
|
47
|
+
when 'body'
|
48
|
+
parse_bodies(value)
|
46
49
|
else
|
47
50
|
raise UnknownAttributeError.new "Unknown method key: #{key}"
|
48
51
|
end
|
@@ -61,6 +64,12 @@ module Raml
|
|
61
64
|
end
|
62
65
|
end
|
63
66
|
|
67
|
+
def parse_bodies(bodies)
|
68
|
+
bodies.each do |type, body_attributes|
|
69
|
+
method.bodies << Raml::Parser::Body.new.parse(type, body_attributes)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
64
73
|
def apply_parents_traits
|
65
74
|
parent.trait_names.each do |name|
|
66
75
|
apply_trait(name)
|
data/lib/raml/resource.rb
CHANGED
@@ -3,10 +3,10 @@ module Raml
|
|
3
3
|
attr_accessor :parent, :methods, :uri_partial, :resources
|
4
4
|
|
5
5
|
def initialize(parent, uri_partial)
|
6
|
-
@parent
|
6
|
+
@parent = parent
|
7
7
|
@uri_partial = uri_partial
|
8
|
-
@methods
|
9
|
-
@resources
|
8
|
+
@methods = []
|
9
|
+
@resources = []
|
10
10
|
end
|
11
11
|
|
12
12
|
def path
|
data/lib/raml/response.rb
CHANGED
@@ -3,16 +3,12 @@ module Raml
|
|
3
3
|
attr_accessor :code, :bodies
|
4
4
|
|
5
5
|
def initialize(code)
|
6
|
-
@code
|
6
|
+
@code = code
|
7
7
|
@bodies = []
|
8
8
|
end
|
9
9
|
|
10
10
|
def content_types
|
11
|
-
|
12
|
-
bodies.each do |body|
|
13
|
-
types << body.content_type
|
14
|
-
end
|
15
|
-
end.uniq
|
11
|
+
bodies.map {|body| body.content_type }.uniq
|
16
12
|
end
|
17
13
|
|
18
14
|
end
|
data/lib/raml/version.rb
CHANGED
data/raml-rb.gemspec
CHANGED
@@ -4,21 +4,21 @@ describe Hash do
|
|
4
4
|
|
5
5
|
describe '#deep_merge' do
|
6
6
|
subject { { key: 'left' }.deep_merge({ key: 'right'}) }
|
7
|
-
it {
|
7
|
+
it { is_expected.to eq({ key: 'right' }) }
|
8
8
|
|
9
9
|
context 'nested hash' do
|
10
10
|
subject { { key: { key: { key: 'left' } } }.deep_merge({ key: { key: { key: 'right' } } }) }
|
11
|
-
it {
|
11
|
+
it { is_expected.to eq({ key: { key: { key: 'right' } } }) }
|
12
12
|
end
|
13
13
|
|
14
14
|
context 'nested hash with nil on original hash' do
|
15
15
|
subject { { key: { key: { key: nil } } }.deep_merge({ key: { key: { key: 'right' } } }) }
|
16
|
-
it {
|
16
|
+
it { is_expected.to eq({ key: { key: { key: 'right' } } }) }
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'nested hash with nil on merged hash' do
|
20
20
|
subject { { key: { key: { key: 'left' } } }.deep_merge({ key: { key: { key: nil } } }) }
|
21
|
-
it {
|
21
|
+
it { is_expected.to eq({ key: { key: { key: nil } } }) }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
data/spec/lib/raml/body_spec.rb
CHANGED
@@ -11,21 +11,21 @@ describe Raml::Body do
|
|
11
11
|
let(:body) { Raml::Body.new('the content_type') }
|
12
12
|
before { body.content_type = 'content_type' }
|
13
13
|
subject { body.content_type }
|
14
|
-
it {
|
14
|
+
it { is_expected.to eq('content_type') }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#schema' do
|
18
18
|
let(:body) { Raml::Body.new('the content_type') }
|
19
19
|
before { body.schema = 'schema' }
|
20
20
|
subject { body.schema }
|
21
|
-
it {
|
21
|
+
it { is_expected.to eq('schema') }
|
22
22
|
end
|
23
23
|
|
24
24
|
describe '#example' do
|
25
25
|
let(:body) { Raml::Body.new('the content_type') }
|
26
26
|
before { body.example = 'example' }
|
27
27
|
subject { body.example }
|
28
|
-
it {
|
28
|
+
it { is_expected.to eq('example') }
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
@@ -6,14 +6,14 @@ describe Raml::Documentation do
|
|
6
6
|
let(:documentation) { Raml::Documentation.new }
|
7
7
|
before { documentation.title = 'the title' }
|
8
8
|
subject { documentation.title }
|
9
|
-
it {
|
9
|
+
it { is_expected.to eq('the title') }
|
10
10
|
end
|
11
11
|
|
12
12
|
describe '#content' do
|
13
13
|
let(:documentation) { Raml::Documentation.new }
|
14
14
|
before { documentation.content = 'the content' }
|
15
15
|
subject { documentation.content }
|
16
|
-
it {
|
16
|
+
it { is_expected.to eq('the content') }
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -11,7 +11,7 @@ describe Raml::Method do
|
|
11
11
|
let(:documentation) { Raml::Documentation.new }
|
12
12
|
before { documentation.title = 'the title' }
|
13
13
|
subject { documentation.title }
|
14
|
-
it {
|
14
|
+
it { is_expected.to eq('the title') }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#response_code' do
|
@@ -8,7 +8,7 @@ describe Raml::Parser::Body do
|
|
8
8
|
describe '#parse' do
|
9
9
|
subject { instance.parse(type, attribute) }
|
10
10
|
|
11
|
-
it {
|
11
|
+
it { is_expected.to be_kind_of Raml::Body }
|
12
12
|
its(:schema) { should == 'dogs' }
|
13
13
|
its(:example) { should == 'cats' }
|
14
14
|
end
|
@@ -16,7 +16,7 @@ describe Raml::Parser::Body do
|
|
16
16
|
describe '#body' do
|
17
17
|
before { instance.parse(type, attribute) }
|
18
18
|
subject { instance.body }
|
19
|
-
it {
|
19
|
+
it { is_expected.to be_kind_of Raml::Body }
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -7,7 +7,7 @@ describe Raml::Parser::Documentation do
|
|
7
7
|
let(:trait_names) { nil }
|
8
8
|
subject { Raml::Parser::Documentation.new.parse(attribute) }
|
9
9
|
|
10
|
-
it {
|
10
|
+
it { is_expected.to be_kind_of Raml::Documentation }
|
11
11
|
its(:title) { should == 'The title' }
|
12
12
|
its(:content) { should == 'The content' }
|
13
13
|
end
|
@@ -3,20 +3,21 @@ require 'raml/parser/method'
|
|
3
3
|
describe Raml::Parser::Method do
|
4
4
|
|
5
5
|
describe '#parse' do
|
6
|
-
let(:attributes) { { 'description' => 'The description', 'headers' => [{ 'key' => 'value' }], 'responses' => ['cats'], 'query_parameters' => ['dogs'] } }
|
6
|
+
let(:attributes) { { 'description' => 'The description', 'headers' => [{ 'key' => 'value' }], 'responses' => ['cats'], 'query_parameters' => ['dogs'], 'body' => { 'application/json' => { 'example' => '{"cats": "dogs"}'} } } }
|
7
7
|
let(:parent) { double(traits: { 'cats' => { 'description' => 'Trait description', 'headers' => { 'trait_key' => 'trait_value' } } }, trait_names: nil) }
|
8
8
|
before do
|
9
|
-
Raml::Parser::Response.
|
10
|
-
Raml::Parser::QueryParameter.
|
9
|
+
allow_any_instance_of(Raml::Parser::Response).to receive(:parse).and_return('cats')
|
10
|
+
allow_any_instance_of(Raml::Parser::QueryParameter).to receive(:parse).and_return('dogs')
|
11
11
|
end
|
12
12
|
subject { Raml::Parser::Method.new(parent).parse('get', attributes) }
|
13
13
|
|
14
|
-
it {
|
14
|
+
it { is_expected.to be_kind_of Raml::Method }
|
15
15
|
its(:method) { should == 'get' }
|
16
16
|
its(:description) { should == 'The description' }
|
17
17
|
its(:headers) { should == [ { 'key' => 'value' } ] }
|
18
18
|
its(:responses) { should == ['cats'] }
|
19
19
|
its(:query_parameters) { should == ['dogs'] }
|
20
|
+
its(:'bodies.first.example') { should == '{"cats": "dogs"}' }
|
20
21
|
|
21
22
|
context 'with trait' do
|
22
23
|
let(:attributes) { { 'is' => [ 'cats' ], 'responses' => ['cats'], 'query_parameters' => ['dogs'] } }
|
@@ -8,7 +8,7 @@ describe Raml::Parser::QueryParameter do
|
|
8
8
|
describe '#parse' do
|
9
9
|
subject { instance.parse(type, attribute) }
|
10
10
|
|
11
|
-
it {
|
11
|
+
it { is_expected.to be_kind_of Raml::QueryParameter }
|
12
12
|
its(:description) { should == 'dogs' }
|
13
13
|
its(:type) { should == 'cats' }
|
14
14
|
its(:example) { should == 'birds' }
|
@@ -17,7 +17,7 @@ describe Raml::Parser::QueryParameter do
|
|
17
17
|
describe '#query_parameter' do
|
18
18
|
before { instance.parse(type, attribute) }
|
19
19
|
subject { instance.query_parameter }
|
20
|
-
it {
|
20
|
+
it { is_expected.to be_kind_of Raml::QueryParameter }
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
@@ -12,7 +12,7 @@ describe Raml::Parser::Resource do
|
|
12
12
|
|
13
13
|
describe '#parse' do
|
14
14
|
subject { instance.parse(parent_node, uri_partial, attributes) }
|
15
|
-
it {
|
15
|
+
it { is_expected.to be_kind_of Raml::Resource }
|
16
16
|
|
17
17
|
context 'resource' do
|
18
18
|
before do
|
@@ -21,7 +21,7 @@ describe Raml::Parser::Resource do
|
|
21
21
|
end
|
22
22
|
let(:attributes) { { '/bar' => {} } }
|
23
23
|
it 'should create a method' do
|
24
|
-
resource.resources.
|
24
|
+
expect(resource.resources).to have_received('<<').with(kind_of(Raml::Resource))
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -47,7 +47,7 @@ describe Raml::Parser::Resource do
|
|
47
47
|
describe '#resource' do
|
48
48
|
before { instance.parse(parent_node, uri_partial, attributes) }
|
49
49
|
subject { instance.resource }
|
50
|
-
it {
|
50
|
+
it { is_expected.to be_kind_of Raml::Resource }
|
51
51
|
end
|
52
52
|
|
53
53
|
end
|
@@ -9,10 +9,10 @@ describe Raml::Parser::Response do
|
|
9
9
|
subject { instance.parse(code, attribute) }
|
10
10
|
|
11
11
|
before do
|
12
|
-
Raml::Parser::Body.
|
12
|
+
allow_any_instance_of(Raml::Parser::Body).to receive(:parse)
|
13
13
|
end
|
14
14
|
|
15
|
-
it {
|
15
|
+
it { is_expected.to be_kind_of Raml::Response }
|
16
16
|
its(:code) { should == 201 }
|
17
17
|
it 'should call through to body' do
|
18
18
|
expect_any_instance_of(Raml::Parser::Body).to receive(:parse).with('cats', {}).once
|
@@ -23,7 +23,7 @@ describe Raml::Parser::Response do
|
|
23
23
|
describe '#response' do
|
24
24
|
before { instance.parse(code, attribute) }
|
25
25
|
subject { instance.response }
|
26
|
-
it {
|
26
|
+
it { is_expected.to be_kind_of Raml::Response }
|
27
27
|
end
|
28
28
|
|
29
29
|
end
|
@@ -7,7 +7,7 @@ describe Raml::Parser::Root do
|
|
7
7
|
let(:raml) { YAML.load File.read('spec/fixtures/basic.raml') }
|
8
8
|
subject { Raml::Parser::Root.new.parse(raml) }
|
9
9
|
|
10
|
-
it {
|
10
|
+
it { is_expected.to be_kind_of Raml::Root }
|
11
11
|
its(:base_uri) { should == 'http://example.api.com/{version}' }
|
12
12
|
its(:uri) { should == 'http://example.api.com/v1' }
|
13
13
|
its(:version) { should == 'v1' }
|
data/spec/lib/raml/parser.rb
CHANGED
@@ -6,44 +6,44 @@ describe Raml::Parser do
|
|
6
6
|
describe '#parse' do
|
7
7
|
let(:raml) { File.read('spec/fixtures/basic.raml') }
|
8
8
|
before do
|
9
|
-
subject.
|
9
|
+
allow(subject).to receive(:parse)
|
10
10
|
Raml::Parser.new.parse(raml)
|
11
11
|
end
|
12
12
|
subject { Raml::Parser::Root.any_instance }
|
13
13
|
|
14
|
-
it {
|
14
|
+
it { is_expected.to have_received(:stub).with(YAML.load(raml)) }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '.parse' do
|
18
18
|
let(:raml) { File.read('spec/fixtures/basic.raml') }
|
19
19
|
before do
|
20
|
-
subject.
|
20
|
+
allow(subject).to receive(:parse)
|
21
21
|
Raml::Parser.parse(raml)
|
22
22
|
end
|
23
23
|
subject { Raml::Parser.any_instance }
|
24
24
|
|
25
|
-
it {
|
25
|
+
it { is_expected.to have_received(:parse).with(raml) }
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '.parse_file' do
|
29
29
|
let(:raml) { File.read('spec/fixtures/basic.raml') }
|
30
30
|
before do
|
31
|
-
subject.
|
31
|
+
allow(subject).to receive(:parse)
|
32
32
|
Raml::Parser.parse_file('spec/fixtures/basic.raml')
|
33
33
|
end
|
34
34
|
subject { Raml::Parser.any_instance }
|
35
35
|
|
36
|
-
it {
|
36
|
+
it { is_expected.to have_received(:parse).with(raml) }
|
37
37
|
end
|
38
38
|
|
39
39
|
describe '.parse_file' do
|
40
40
|
before do
|
41
|
-
subject.
|
41
|
+
allow(subject).to receive(:parse_file)
|
42
42
|
Raml::Parser.parse_file('path/to/file.raml')
|
43
43
|
end
|
44
44
|
subject { Raml::Parser.any_instance }
|
45
45
|
|
46
|
-
it {
|
46
|
+
it { is_expected.to have_received(:parse_file).with('path/to/file.raml') }
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
@@ -5,35 +5,35 @@ describe Raml::QueryParameter do
|
|
5
5
|
describe '.new' do
|
6
6
|
let(:query_parameter) { Raml::QueryParameter.new('name') }
|
7
7
|
subject { query_parameter.name }
|
8
|
-
it {
|
8
|
+
it { is_expected.to eq('name') }
|
9
9
|
end
|
10
10
|
|
11
11
|
describe '#name' do
|
12
12
|
let(:query_parameter) { Raml::QueryParameter.new('name') }
|
13
13
|
before { query_parameter.name = 'the name' }
|
14
14
|
subject { query_parameter.name }
|
15
|
-
it {
|
15
|
+
it { is_expected.to eq('the name') }
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#description' do
|
19
19
|
let(:query_parameter) { Raml::QueryParameter.new('name') }
|
20
20
|
before { query_parameter.description = 'the description' }
|
21
21
|
subject { query_parameter.description }
|
22
|
-
it {
|
22
|
+
it { is_expected.to eq('the description') }
|
23
23
|
end
|
24
24
|
|
25
25
|
describe '#type' do
|
26
26
|
let(:query_parameter) { Raml::QueryParameter.new('name') }
|
27
27
|
before { query_parameter.type = 'the type' }
|
28
28
|
subject { query_parameter.type }
|
29
|
-
it {
|
29
|
+
it { is_expected.to eq('the type') }
|
30
30
|
end
|
31
31
|
|
32
32
|
describe '#example' do
|
33
33
|
let(:query_parameter) { Raml::QueryParameter.new('name') }
|
34
34
|
before { query_parameter.example = 'the example' }
|
35
35
|
subject { query_parameter.example }
|
36
|
-
it {
|
36
|
+
it { is_expected.to eq('the example') }
|
37
37
|
end
|
38
38
|
|
39
39
|
end
|
@@ -14,20 +14,20 @@ describe Raml::Resource do
|
|
14
14
|
let(:parent) { double(uri: 'http://www.example.com') }
|
15
15
|
let(:uri_partial) { '/cats' }
|
16
16
|
subject { Raml::Resource.new(parent, uri_partial).uri }
|
17
|
-
it {
|
17
|
+
it { is_expected.to eq('http://www.example.com/cats') }
|
18
18
|
|
19
19
|
context 'partial no slash' do
|
20
20
|
let(:uri_partial) { 'cats' }
|
21
|
-
it {
|
21
|
+
it { is_expected.to eq('http://www.example.com/cats') }
|
22
22
|
end
|
23
23
|
|
24
24
|
context 'base trailing slash' do
|
25
25
|
let(:parent) { double(uri: 'http://www.example.com') }
|
26
|
-
it {
|
26
|
+
it { is_expected.to eq('http://www.example.com/cats') }
|
27
27
|
|
28
28
|
context 'partial no slash' do
|
29
29
|
let(:uri_partial) { 'cats' }
|
30
|
-
it {
|
30
|
+
it { is_expected.to eq('http://www.example.com/cats') }
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -12,14 +12,14 @@ describe Raml::Response do
|
|
12
12
|
let(:response) { Raml::Response.new(201) }
|
13
13
|
before { response.code = 'the code' }
|
14
14
|
subject { response.code }
|
15
|
-
it {
|
15
|
+
it { is_expected.to eq('the code') }
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '#bodies' do
|
19
19
|
let(:response) { Raml::Response.new(201) }
|
20
20
|
before { response.bodies = 'the bodies' }
|
21
21
|
subject { response.bodies }
|
22
|
-
it {
|
22
|
+
it { is_expected.to eq('the bodies') }
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
data/spec/lib/raml/root_spec.rb
CHANGED
@@ -4,33 +4,33 @@ describe Raml::Root do
|
|
4
4
|
|
5
5
|
describe '#resources' do
|
6
6
|
subject { Raml::Root.new.resources }
|
7
|
-
it {
|
7
|
+
it { is_expected.to be_kind_of Array }
|
8
8
|
end
|
9
9
|
|
10
10
|
describe '#documentation' do
|
11
11
|
subject { Raml::Root.new.documentation }
|
12
|
-
it {
|
12
|
+
it { is_expected.to be_kind_of Array }
|
13
13
|
end
|
14
14
|
|
15
15
|
describe '#uri' do
|
16
16
|
let(:root) { Raml::Root.new }
|
17
17
|
before { root.base_uri = 'http://example.com' }
|
18
18
|
subject { root.uri }
|
19
|
-
it {
|
19
|
+
it { is_expected.to eq('http://example.com') }
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#title' do
|
23
23
|
let(:root) { Raml::Root.new }
|
24
24
|
before { root.title = 'My RAML' }
|
25
25
|
subject { root.title }
|
26
|
-
it {
|
26
|
+
it { is_expected.to eq('My RAML') }
|
27
27
|
end
|
28
28
|
|
29
29
|
describe '#version' do
|
30
30
|
let(:root) { Raml::Root.new }
|
31
31
|
before { root.version = '1.0' }
|
32
32
|
subject { root.version }
|
33
|
-
it {
|
33
|
+
it { is_expected.to eq('1.0') }
|
34
34
|
end
|
35
35
|
|
36
36
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raml-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Brennan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.8'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.8'
|
69
83
|
description:
|
70
84
|
email:
|
71
85
|
- james@jamesbrennan.ca
|
@@ -75,6 +89,7 @@ extra_rdoc_files: []
|
|
75
89
|
files:
|
76
90
|
- ".gitignore"
|
77
91
|
- ".rspec"
|
92
|
+
- ".travis.yml"
|
78
93
|
- Gemfile
|
79
94
|
- LICENSE.txt
|
80
95
|
- README.md
|
@@ -140,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
155
|
version: '0'
|
141
156
|
requirements: []
|
142
157
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.5.1
|
144
159
|
signing_key:
|
145
160
|
specification_version: 4
|
146
161
|
summary: A RAML parser implemented in Ruby
|