Skip to content

Instantly share code, notes, and snippets.

@FrancescaK
Last active December 20, 2015 18:58
Show Gist options
  • Save FrancescaK/6179564 to your computer and use it in GitHub Desktop.
Save FrancescaK/6179564 to your computer and use it in GitHub Desktop.
Step Definitions
Given /^an IO stream containing ([0-9a-fA-F]+)$/ do |hex_bytes|
@io = StringIO.new([hex_bytes].pack('H*'))
end
When /^I deserialize the stream$/ do
@document = Hash.from_bson(@io)
end
Then /^the result should be the ((?:\S+) value (?:\S+))$/ do |value|
@document['k'].should eq(value)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment