Sha256: 1d88ea37d143f14a87905b94dadd8b1f62a429ebb8355925dd3683af455e1b3d

Contents?: true

Size: 518 Bytes

Versions: 8

Compression:

Stored size: 518 Bytes

Contents

# coding: utf-8
module Trees
  def expect_node_key_data(node, key, data)
    expect(node.full_key(root: false)).to eq key
    expect(node.data).to eq data
  end

  def build_tree(hash)
    I18n::Tasks::Data::Tree::Siblings.from_nested_hash(hash)
  end

  def build_node(attr = {})
    raise 'invalid node (more than 1 root)' if attr.size > 1
    key, value = attr.first
    I18n::Tasks::Data::Tree::Node.from_key_value(key, value)
  end

  def new_node(attr = {})
    I18n::Tasks::Data::Tree::Node.new(attr)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
i18n-tasks-0.8.5 spec/support/trees.rb
i18n-tasks-0.8.4 spec/support/trees.rb
i18n-tasks-0.8.3 spec/support/trees.rb
i18n-tasks-0.8.2 spec/support/trees.rb
i18n-tasks-0.8.1 spec/support/trees.rb
i18n-tasks-0.8.0 spec/support/trees.rb
i18n-tasks-0.7.13 spec/support/trees.rb
i18n-tasks-0.7.12 spec/support/trees.rb