lib/fwtoolkit/test/model_helper.rb in fwtoolkit-0.6.3 vs lib/fwtoolkit/test/model_helper.rb in fwtoolkit-0.6.4
- old
+ new
@@ -76,6 +76,19 @@
plist.save(plist_file, CFPropertyList::List::FORMAT_BINARY)
end
end
end
end
-World(FWToolkit::Test::ModelHelpers)
+World(FWToolkit::Test::ModelHelpers)
+
+
+# add as_json to Array
+class Array
+ def to_json(*)
+ contents = ""
+ self.each_index do |i|
+ contents << self[i].to_json
+ contents << ',' unless i == self.length - 1
+ end
+ "[#{contents}]"
+ end
+end
\ No newline at end of file