Skip to content

Commit

Permalink
fix: weaker error expectation, since Rubinius has another KeyError me…
Browse files Browse the repository at this point in the history
…ssage format
  • Loading branch information
marcelotto committed Apr 23, 2016
1 parent 5784aae commit ae045c5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/unit/sycamore/tree/access_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@
end

it 'does behave like fetch, when no child tree at the given path present' do
expect { example_tree.fetch Sycamore::Path[:missing, :foo] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch Sycamore::Path[:foo, :missing, :baz] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch Sycamore::Path[:foo, :bar, :missing] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch Sycamore::Path[:missing_node, :foo] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch Sycamore::Path[:foo, :missing_node, :baz] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch Sycamore::Path[:foo, :bar, :missing_node] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch Sycamore::Path[:foo, :bar, :baz] }.to raise_error Sycamore::ChildError, 'node :baz has no child tree'

expect( example_tree.fetch(Sycamore::Path[:missing, :foo ], :default) ).to be :default
Expand Down Expand Up @@ -381,9 +381,9 @@
end

it 'does behave like fetch, when no child tree at the given path present' do
expect { example_tree.fetch_path [:missing, :foo] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path [:foo, :missing, :baz] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path [:foo, :bar, :missing] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path [:missing_node, :foo] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path [:foo, :missing_node, :baz] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path [:foo, :bar, :missing_node] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path [:foo, :bar, :baz] }.to raise_error Sycamore::ChildError, 'node :baz has no child tree'

expect( example_tree.fetch_path([:missing, :foo ], :default) ).to be :default
Expand All @@ -400,9 +400,9 @@
end

it 'does behave like fetch, when no child tree at the given path present' do
expect { example_tree.fetch_path Sycamore::Path[:missing, :foo] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path Sycamore::Path[:foo, :missing, :baz] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path Sycamore::Path[:foo, :bar, :missing] }.to raise_error KeyError, 'key not found: :missing'
expect { example_tree.fetch_path Sycamore::Path[:missing_node, :foo] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path Sycamore::Path[:foo, :missing_node, :baz] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path Sycamore::Path[:foo, :bar, :missing_node] }.to raise_error KeyError, /missing_node/
expect { example_tree.fetch_path Sycamore::Path[:foo, :bar, :baz] }.to raise_error Sycamore::ChildError, 'node :baz has no child tree'

expect( example_tree.fetch_path(Sycamore::Path[:missing, :foo ], :default) ).to be :default
Expand Down

0 comments on commit ae045c5

Please sign in to comment.