|
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.instance_variable_get(:@schema)[:required]).to be_nil |
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 | + schema_data = schema.instance_variable_get(:@schema) |
| 69 | + expect(schema_data[:properties]).to have_key(:package_path) |
| 70 | + expect(schema_data[:required]).to be_nil |
70 | 71 | end |
71 | 72 | end |
72 | 73 |
|
|
86 | 87 |
|
87 | 88 | it 'has package_path as required argument' do |
88 | 89 | schema = described_class.input_schema |
89 | | - expect(schema.properties).to have_key(:package_path) |
90 | | - expect(schema.required).to include(:package_path) |
| 90 | + schema_data = schema.instance_variable_get(:@schema) |
| 91 | + expect(schema_data[:properties]).to have_key(:package_path) |
| 92 | + expect(schema_data[:required]).to include('package_path') |
91 | 93 | end |
92 | 94 | end |
93 | 95 |
|
|
123 | 125 |
|
124 | 126 | it 'has correct argument requirements' do |
125 | 127 | 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) |
| 128 | + schema_data = schema.instance_variable_get(:@schema) |
| 129 | + expect(schema_data[:properties]).to have_key(:package_path) |
| 130 | + expect(schema_data[:properties]).to have_key(:constant_name) |
| 131 | + expect(schema_data[:required]).to include('package_path') |
| 132 | + expect(schema_data[:required]).not_to include('constant_name') |
130 | 133 | end |
131 | 134 | end |
132 | 135 |
|
|
162 | 165 |
|
163 | 166 | it 'has correct argument requirements' do |
164 | 167 | 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) |
| 168 | + schema_data = schema.instance_variable_get(:@schema) |
| 169 | + expect(schema_data[:properties]).to have_key(:package_path) |
| 170 | + expect(schema_data[:properties]).to have_key(:constant_name) |
| 171 | + expect(schema_data[:required]).to include('package_path') |
| 172 | + expect(schema_data[:required]).not_to include('constant_name') |
169 | 173 | end |
170 | 174 | end |
171 | 175 | end |
0 commit comments