Sha256: 5474d31aaa6395baf50686a16fbe548f9daadb3f3106eae7f9a5b1a9f0a4f9a1
Contents?: true
Size: 1.17 KB
Versions: 5
Compression:
Stored size: 1.17 KB
Contents
require File.dirname(__FILE__) + '/test_helper' class FieldSetTest < Presenting::Test def setup @set = Presenting::FieldSet.new(Presenting::Attribute, :name, :value) end def test_reading_a_field_by_name @set << "foo" assert_equal "foo", @set["foo"].name end def test_pushing_a_field_by_name @set << "foo" assert_equal "foo", @set.first.name end def test_pushing_a_field_by_name_and_value @set << {"foo" => :bar} assert_equal "foo", @set.first.name assert_equal :bar, @set.first.value end def test_pushing_a_field_by_name_and_options @set << {"foo" => {:value => :bar}} assert_equal "foo", @set.first.name assert_equal :bar, @set.first.value end def test_adding_a_field_by_name @set["foo"] = nil assert_equal "foo", @set.first.name end def test_adding_a_field_by_name_and_value @set["foo"] = :bar assert_equal "foo", @set.first.name assert_equal :bar, @set.first.value end def test_adding_a_field_by_name_and_options @set["foo"] = {:value => :bar} assert_equal "foo", @set.first.name assert_equal :bar, @set.first.value end end
Version data entries
5 entries across 5 versions & 1 rubygems