|
37 | 37 |
|
38 | 38 | it 'has no required arguments' do |
39 | 39 | schema = described_class.input_schema |
40 | | - expect(schema.required).to be_empty |
| 40 | + expect(schema.to_h[:required]).to be_nil.or(be_empty) |
41 | 41 | end |
42 | 42 | end |
43 | 43 |
|
|
65 | 65 |
|
66 | 66 | it 'has package_path as optional argument' do |
67 | 67 | schema = described_class.input_schema |
68 | | - expect(schema.properties).to have_key(:package_path) |
69 | | - expect(schema.required).not_to include(:package_path) |
| 68 | + expect(schema.to_h[:properties]).to have_key(:package_path) |
| 69 | + expect(schema.to_h[:required]).to satisfy { |r| r.nil? || !r.include?('package_path') } |
70 | 70 | end |
71 | 71 | end |
72 | 72 |
|
|
86 | 86 |
|
87 | 87 | it 'has package_path as required argument' do |
88 | 88 | schema = described_class.input_schema |
89 | | - expect(schema.properties).to have_key(:package_path) |
90 | | - expect(schema.required).to include(:package_path) |
| 89 | + expect(schema.to_h[:properties]).to have_key(:package_path) |
| 90 | + expect(schema.to_h[:required]).to include('package_path') |
91 | 91 | end |
92 | 92 | end |
93 | 93 |
|
|
123 | 123 |
|
124 | 124 | it 'has correct argument requirements' do |
125 | 125 | schema = described_class.input_schema |
126 | | - expect(schema.properties).to have_key(:package_path) |
127 | | - expect(schema.properties).to have_key(:constant_name) |
128 | | - expect(schema.required).to include(:package_path) |
129 | | - expect(schema.required).not_to include(:constant_name) |
| 126 | + expect(schema.to_h[:properties]).to have_key(:package_path) |
| 127 | + expect(schema.to_h[:properties]).to have_key(:constant_name) |
| 128 | + expect(schema.to_h[:required]).to include('package_path') |
| 129 | + expect(schema.to_h[:required]).not_to include('constant_name') |
130 | 130 | end |
131 | 131 | end |
132 | 132 |
|
|
162 | 162 |
|
163 | 163 | it 'has correct argument requirements' do |
164 | 164 | schema = described_class.input_schema |
165 | | - expect(schema.properties).to have_key(:package_path) |
166 | | - expect(schema.properties).to have_key(:constant_name) |
167 | | - expect(schema.required).to include(:package_path) |
168 | | - expect(schema.required).not_to include(:constant_name) |
| 165 | + expect(schema.to_h[:properties]).to have_key(:package_path) |
| 166 | + expect(schema.to_h[:properties]).to have_key(:constant_name) |
| 167 | + expect(schema.to_h[:required]).to include('package_path') |
| 168 | + expect(schema.to_h[:required]).not_to include('constant_name') |
169 | 169 | end |
170 | 170 | end |
171 | 171 | end |
0 commit comments