Skip to content

Instantly share code, notes, and snippets.

View cored's full-sized avatar
🐽
Hacking Everything

Rafael George cored

🐽
Hacking Everything
View GitHub Profile
def self.call(payload)
new(body: payload).call
end
def initialize(body:)
@body = body
end
package cloudwatch_test
import (
"context"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
klass = Object.const_get("FakestZuora::#{class_name.to_s.constantize}")
require "minitest/autorun"
module Anagram
def self.call(words, str)
words.select do |word|
word if (word.chars.sort == str.chars.sort) && word != str
end
end
end
require "minitest/autorun"
module Anagram
def self.call(words, str)
[]
end
end
describe Anagram do
it "when we pass an empty string" do
require "minitest/autorun"
module Anagram
def self.call(words, str)
end
end
require "minitest/autorun"
module Anagram
end
describe Anagram do
it "when we pass an empty string" do
words = ["apple", "orange"]
str = ""
def determine_whether_parcel_or_non_forward_stocked_nwgd
if transit_legs.present?
shipping_method_from_shipping_preference
else
"parcel"
end
end
def unreserve_shipment(shipment)
shipment.update_attributes(:shipment_batch_id => nil)
Inventory::Reservations.unreserve_shipment(shipment)
end
context "with different shipping preferences" do
let(:shipment1) { build(:shipment, shipping_preference: "parcel", products: [product_a]) }
let(:shipment2) { build(:shipment, shipping_preference: "courier", products: [product_b]) }
it "does not swap for the bundling product" do
expect(shipments_out).to match_array(shipments_in)
expect(products_skus_in_shipments(shipments_out)).to match_array(
[
[product_a.sku],
[product_b.sku],