Skip to content

Commit

Permalink
Fix misleading error message for non configured mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Dec 21, 2015
1 parent 5196e5f commit 92bb189
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lotus/model/adapters/null_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Adapters
# @since 0.2.0
class NoAdapterError < Lotus::Model::Error
def initialize(method_name)
super("Cannot invoke `#{ method_name }' without selecting an adapter. Please check your framework configuration.")
super("Cannot invoke `#{ method_name }' on repository. Please check if `adapter' and `mapping' are set.")
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/integration/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
describe "when a repository isn't mapped" do
it 'raises an error when try to use it' do
exception = -> { UnmappedRepository.find(1) }.must_raise(Lotus::Model::Adapters::NoAdapterError)
exception.message.must_equal("Cannot invoke `find' without selecting an adapter. Please check your framework configuration.")
exception.message.must_equal("Cannot invoke `find' on repository. Please check if `adapter' and `mapping' are set.")
end
end

Expand Down

0 comments on commit 92bb189

Please sign in to comment.