Allow floats in X/Y/Z

pull/910/head
Rick Carlino 2018-07-13 08:04:41 -05:00
parent 5946f00533
commit fe8fe4d9de
2 changed files with 5 additions and 5 deletions

View File

@ -80,9 +80,9 @@ module CeleryScriptSettingsBag
.arg(:url, [String])
.arg(:value, [String, Integer, TrueClass, FalseClass])
.arg(:version, [Integer])
.arg(:x, [Integer])
.arg(:y, [Integer])
.arg(:z, [Integer])
.arg(:x, [Integer, Float])
.arg(:y, [Integer, Float])
.arg(:z, [Integer, Float])
.arg(:pin_id, [Integer])
.arg(:pin_type, [String]) do |node|
within(ALLOWED_PIN_TYPES, node) do |val|

View File

@ -60,8 +60,8 @@ describe CeleryScript::Checker do
it 'handles wrong leaf types' do
hash[:body][0][:args][:location][:args][:x] = "supposed to be an Integer"
result = checker.run
expect(result.message).to eq("Expected leaf 'x' within 'coordinate' to"\
" be one of: [Integer] but got String")
expect(result.message).to eq("Expected leaf 'x' within 'coordinate' to be "\
"one of: [Integer, Float] but got String")
end
it "finds a bad leaf" do