Sha256: 66777f2b81ca8cc8e96cf8de79000f040c94b7bfef29d47a1ddcd5be697f233f
Contents?: true
Size: 1.3 KB
Versions: 6
Compression:
Stored size: 1.3 KB
Contents
# coding: utf-8 module Fog module SakuraCloud class Script class Real def create_note(options) body = { "Note" => { "Name" => options[:name], "Content" => options[:content] } } request( :headers => { 'Authorization' => "Basic #{@auth_encord}" }, :expects => 201, :method => 'POST', :path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/note", :body => Fog::JSON.encode(body) ) end end # Real class Mock def create_note(options) response = Excon::Response.new response.status = 201 response.body = { "Note"=> {"ID"=>"112700759852", "Name"=>"foobar", "Class"=>"shell", "Scope"=>"user", "Content"=>"#!/bin/bash", "Description"=>"", "Remark"=>nil, "Availability"=>"available", "CreatedAt"=>"2015-09-05T20:32:12+09:00", "ModifiedAt"=>"2015-09-05T20:32:12+09:00", "Icon"=>nil, "Tags"=>[]}, "Success"=>true, "is_ok"=>true} response end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems