lib/wasm_spec.rb in streamdal-0.0.3 vs lib/wasm_spec.rb in streamdal-0.0.4

- old
+ new

@@ -39,11 +39,11 @@ end end context 'detective.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'detective.wasm')) + wasm_bytes = load_wasm('detective.wasm') @step = Streamdal::Protos::PipelineStep.new @step.name = 'detective' @step._wasm_bytes = wasm_bytes.b @step._wasm_id = SecureRandom.uuid @@ -75,11 +75,11 @@ end end context 'httprequest.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'httprequest.wasm')) + wasm_bytes = load_wasm('httprequest.wasm') http_req_step = Streamdal::Protos::HttpRequestStep.new http_req_step.request = Streamdal::Protos::HttpRequest.new http_req_step.request.url = 'https://www.google.com/404_me' http_req_step.request.method = :HTTP_REQUEST_METHOD_GET @@ -102,11 +102,11 @@ end end context 'inferschema.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'inferschema.wasm')) + wasm_bytes = load_wasm('inferschema.wasm') @step = Streamdal::Protos::PipelineStep.new @step.name = 'schema inference' @step._wasm_bytes = wasm_bytes.b @step._wasm_id = SecureRandom.uuid @@ -128,11 +128,11 @@ end end context 'transform.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'transform.wasm')) + wasm_bytes = load_wasm('transform.wasm') @step = Streamdal::Protos::PipelineStep.new @step.name = 'transform' @step._wasm_bytes = wasm_bytes.b @step._wasm_id = SecureRandom.uuid @@ -192,11 +192,11 @@ end end context 'validjson.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'validjson.wasm')) + wasm_bytes = load_wasm('validjson.wasm') @step = Streamdal::Protos::PipelineStep.new @step.name = 'validate json' @step._wasm_bytes = wasm_bytes.b @step._wasm_id = SecureRandom.uuid @@ -224,10 +224,10 @@ end end context 'kv.wasm' do before(:each) do - wasm_bytes = File.read(File.join(File.dirname(__FILE__), '..', 'test-assets', 'wasm', 'kv.wasm')) + wasm_bytes = load_wasm('kv.wasm') client.kv.set('test', 'test') @step = Streamdal::Protos::PipelineStep.new @step.name = 'kv exists' \ No newline at end of file