class Object
Public Instance Methods
slnky_command(name)
click to toggle source
# File lib/slnky/spec/helper.rb, line 17 def slnky_command(name) @commands ||= {} @commands[name] ||= begin file = File.expand_path("#{Dir.pwd}/test/commands/#{name}.json", __FILE__) raise "file #{file} not found" unless File.exists?(file) Slnky::Command::Request.new(JSON.parse(File.read(file))) end end
slnky_event(name)
click to toggle source
# File lib/slnky/spec/helper.rb, line 8 def slnky_event(name) @events ||= {} @events[name] ||= begin file = File.expand_path("#{Dir.pwd}/test/events/#{name}.json", __FILE__) raise "file #{file} not found" unless File.exists?(file) Slnky::Message.new(JSON.parse(File.read(file))) end end
slnky_response(route, service)
click to toggle source
# File lib/slnky/spec/helper.rb, line 26 def slnky_response(route, service) @responses ||= {} @responses[route] ||= begin response = Slnky::Command::Response.new(route, service) response.exchange = Slnky::Transport::MockExchange.new response end end