Skip to content

Instantly share code, notes, and snippets.

View MelissaKaulfuss's full-sized avatar

Melissa Kaulfuss MelissaKaulfuss

View GitHub Profile
@MelissaKaulfuss
MelissaKaulfuss / gist:2efc0b6419f4ecbf4c3a12421f00905b
Last active March 21, 2018 10:14
VCR gem grappling and learnings.

Today I had to add a parameter to a request we were sending to an external API.

My unit test passed ✅ The acceptance specs did not - I had 20 failures. ❌

The failures were super cryptic, something about not being able to merge Nil:NilClass into a hash or something weirdly unrelated. One of my colleagues suspected it was to do with the VCR gem we used to simulate HTTP requests/responses from APIs.

Turns out VCR uses query strings as the key for the cassette (I did not know this). Because I'd added a param to the query string, the existing string (in the cassettes) was broken.

@MelissaKaulfuss
MelissaKaulfuss / no_code_in_docker_image.md
Last active January 16, 2018 22:25
No code in a Docker Image?

The issue

Yesterday when attempting to initialize /.init a Docker Container (for the first time) I got a strange error that I just assumed was down to my set up. Hadn't yet spun this up on my new machine.

The failure occurred when hitting exec bundle exec rake db:create.

The error output:

Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, 
perhaps you meant to add it to your Gemfile?
@MelissaKaulfuss
MelissaKaulfuss / gist:6b109bccea81612c916672660b6a5ce6
Created September 6, 2017 07:11
Illustration of class methods and instance methods (I think!)
irb(main):001:0> class A
irb(main):002:1> def self.cow
irb(main):003:2> "hello I am a cow"
irb(main):004:2> end
irb(main):005:1> def moo
irb(main):006:2> "Mooooo!"
irb(main):007:2> end
irb(main):008:1> end
=> :moo
irb(main):009:0> A.cow
@MelissaKaulfuss
MelissaKaulfuss / aws_datamigration_service.md
Created April 28, 2017 10:58 — forked from wolfeidau/aws_datamigration_service.md
Conversation on viewsource slack about postgresql and AWS datamigration service.