Skip to content

Commit

Permalink
. allow mapping to a custom class if the mapped class supports two ar…
Browse files Browse the repository at this point in the history
…guments
  • Loading branch information
beatrichartz committed Sep 8, 2012
1 parent 6d6ed82 commit 94969cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source :gemcutter

gem 'rails', '>= 3.2.0'
gem 'rails', '>= 3.0.0'

group :test do
gem 'rake'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -96,7 +96,7 @@ PLATFORMS
ruby

DEPENDENCIES
rails (>= 3.2.0)
rails (>= 3.0.0)
rake
rspec (>= 2.0.0)
rspec-rails (>= 2.0.0)
6 changes: 3 additions & 3 deletions spec/lib/view_models/helpers/mapping_spec.rb
Expand Up @@ -18,12 +18,12 @@ class ViewModels::SomeModelClazz < ViewModels::Base; end
it "should return an empty hash by default" do
specific_view_model_mapping.should == {}
end
it "should raise an ArgumentError on an non-mapped model" do
class SomeViewModelClass; end
it "should raise an ArgumentError on model that does not support 2 arguments" do
class SomeViewModelClass; def initialize; end; end
specific_view_model_mapping[String] = SomeViewModelClass
lambda {
view_model_for("Some String")
}.should raise_error(ArgumentError)
}.should raise_error(ArgumentError, /2 for 0/)
end
end
describe "no specific mapping" do
Expand Down

0 comments on commit 94969cf

Please sign in to comment.