Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trying to get tests passing

  • Loading branch information...
commit 1ca64bddddca247f2bf6c338d12da20f3d4b048c 1 parent 5b10032
@adelevie authored
Showing with 3 additions and 1 deletion.
  1. +2 −0  lib/parse_resource/base.rb
  2. +1 −1  test/test_parse_resource.rb
View
2  lib/parse_resource/base.rb
@@ -37,6 +37,7 @@ def initialize(attributes = {}, new=true)
if new
@unsaved_attributes = attributes
+ @unsaved_attributes.stringify_keys!
else
@unsaved_attributes = {}
end
@@ -52,6 +53,7 @@ def initialize(attributes = {}, new=true)
# @param [Symbol] name the name of the field, eg `:author`.
# @param [Boolean] val the return value of the field. Only use this within the class.
def self.field(fname, val=nil)
+ fname = fname.to_sym
class_eval do
define_method(fname) do
get_attribute("#{fname}")
View
2  test/test_parse_resource.rb
@@ -68,7 +68,7 @@ def test_count
end
def test_initialize_with_args
- @spoon = Spoon.new(:length => "title1", :width => "ipso")
+ @spoon = Spoon.new("length" => :title1, :width => "ipso")
assert @spoon.is_a?(Spoon)
assert_equal @spoon.length, "title1"
assert_equal @spoon.width, "ipso"
Please sign in to comment.
Something went wrong with that request. Please try again.