summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorArek Turlewicz <aturlewicz@mediweb.jp>2018-08-15 10:50:30 +0900
committerArek Turlewicz <aturlewicz@mediweb.jp>2018-08-15 10:50:30 +0900
commit955d1713a4c101cb9e68020ddb7fe956be734c78 (patch)
tree28835d9de63b0c29b654c0854b2b72ccb98f2d77 /spec
parent4893ca938e243acb07513c3c8b773acf26f72be6 (diff)
downloadhashie-955d1713a4c101cb9e68020ddb7fe956be734c78.tar.gz
Mash should load yaml file.
Diffstat (limited to 'spec')
-rw-r--r--spec/fixtures/yaml_with_aliases.yml11
-rw-r--r--spec/hashie/mash_is_loading_yaml_spec.rb8
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/fixtures/yaml_with_aliases.yml b/spec/fixtures/yaml_with_aliases.yml
new file mode 100644
index 0000000..f442c03
--- /dev/null
+++ b/spec/fixtures/yaml_with_aliases.yml
@@ -0,0 +1,11 @@
+accounts: &base_accounts
+ admin:
+ password: secret
+
+company_a:
+ accounts: &accounts
+ <<: *base_accounts
+
+# company_b:
+# accounts: &accounts
+# <<: *base_accounts
diff --git a/spec/hashie/mash_is_loading_yaml_spec.rb b/spec/hashie/mash_is_loading_yaml_spec.rb
new file mode 100644
index 0000000..f7edea4
--- /dev/null
+++ b/spec/hashie/mash_is_loading_yaml_spec.rb
@@ -0,0 +1,8 @@
+require "spec_helper"
+
+context "load yaml" do
+ it do
+ mash = Hashie::Mash.load("spec/fixtures/yaml_with_aliases.yml")
+ expect(mash.company_a.accounts.admin.password).to eq "secret"
+ end
+end