Sha256: 49c841848fcaeb38a1b26b0528d727a9c33210dddbf971648adf06a35976a47b

Contents?: true

Size: 411 Bytes

Versions: 17

Compression:

Stored size: 411 Bytes

Contents

require 'helper'

class OpenStructTest < Test::Unit::TestCase
  def from_db
    UserConfig.find(@config.id)
  end

  context "working with sets" do
    setup do
      @config = UserConfig.create!(:entries => OpenStruct.new({}))
    end

    should "allow to add new keys" do
      @config.entries.new_key = "my new key"
      @config.save!
      from_db.entries.new_key.should == "my new key"
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mongomapper_ext-0.5.2 test/types/test_open_struct.rb
mongomapper_ext-0.5.1 test/types/test_open_struct.rb
mongomapper_ext-0.5.0 test/types/test_open_struct.rb
mongomapper_ext-0.4.0 test/types/test_open_struct.rb
mongomapper_ext-0.3.0 test/types/test_open_struct.rb
mongomapper_ext-0.2.4 test/types/test_open_struct.rb
mongomapper_ext-0.2.3 test/types/test_open_struct.rb
mongomapper_ext-0.2.2 test/types/test_open_struct.rb
mongomapper_ext-0.2.1 test/types/test_open_struct.rb
mongomapper_ext-0.2.0 test/types/test_open_struct.rb
mongomapper_ext-0.1.5 test/types/test_open_struct.rb
mongomapper_ext-0.1.4 test/types/test_open_struct.rb
mongomapper_ext-0.1.3 test/types/test_open_struct.rb
mongomapper_ext-0.1.2 test/types/test_open_struct.rb
mongomapper_ext-0.1.1 test/types/test_open_struct.rb
mongomapper_ext-0.1.0 test/types/test_open_struct.rb
mongomapper_ext-0.0.4 test/types/test_open_struct.rb