representable 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.textile +10 -0
- data/README.rdoc +34 -0
- data/lib/representable.rb +5 -0
- data/lib/representable/binding.rb +12 -15
- data/lib/representable/bindings/json_bindings.rb +54 -34
- data/lib/representable/bindings/xml_bindings.rb +96 -59
- data/lib/representable/definition.rb +30 -30
- data/lib/representable/json.rb +3 -2
- data/lib/representable/json/collection.rb +38 -0
- data/lib/representable/json/hash.rb +38 -0
- data/lib/representable/version.rb +1 -1
- data/lib/representable/xml.rb +4 -3
- data/lib/representable/xml/collection.rb +38 -0
- data/lib/representable/xml/hash.rb +38 -0
- data/test/definition_test.rb +23 -24
- data/test/json_bindings_test.rb +119 -0
- data/test/json_test.rb +127 -3
- data/test/polymorphic_test.rb +45 -0
- data/test/representable_test.rb +0 -1
- data/test/test_helper.rb +4 -0
- data/test/xml_bindings_test.rb +153 -0
- data/test/xml_test.rb +10 -5
- metadata +109 -73
- data/test/bindings_test.rb +0 -16
data/test/bindings_test.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class BindingsTest < MiniTest::Spec
|
4
|
-
describe "TextRef#read" do
|
5
|
-
def parse_xml(xml); Nokogiri::XML(xml).root; end
|
6
|
-
|
7
|
-
before do
|
8
|
-
@ref = Representable::XML::TextBinding.new(Representable::Definition.new(:song))
|
9
|
-
end
|
10
|
-
|
11
|
-
it "returns found value" do
|
12
|
-
assert_equal "Unkoil", @ref.read(parse_xml("<a><song>Unkoil</song></a>"))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|