Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Trying to fix up specs.

  • Loading branch information...
commit 2644d50c57fd3fc54d62e520ddc53b014df27e49 1 parent 051c06b
Blake Gentry authored
View
4 remarkable_datamapper/lib/remarkable_datamapper/base.rb
@@ -180,7 +180,7 @@ def assert_bad_value(model, attribute, value, error_message_to_expect=:invalid)
#
def error_message_from_model(model, attribute, message) #:nodoc:
if message.is_a? Symbol
- message = if RAILS_I18N # Rails >= 2.2
+ message = if I18N # Rails >= 2.2
model.errors.generate_message(attribute, message, :count => '12345')
else # Rails <= 2.1
::DataMapper::Errors.default_error_messages[message] % '12345'
@@ -240,7 +240,7 @@ def collection_interpolation #:nodoc:
# Returns true if the given collection should be translated.
#
def i18n_collection? #:nodoc:
- RAILS_I18N && I18N_COLLECTION.include?(self.class.matcher_arguments[:collection])
+ I18N && I18N_COLLECTION.include?(self.class.matcher_arguments[:collection])
end
end
View
1  remarkable_datamapper/lib/remarkable_datamapper/describe.rb
@@ -130,6 +130,7 @@ def describe(*args, &block)
:key => translated_key.downcase, :value => value.inspect)
end
+ pp pieces
description << pieces.join(connector)
args.unshift(description)
View
3  remarkable_datamapper/spec/describe_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
-RAILS_I18N = false # specs won't run unless true
+I18N = true # specs won't run unless false
class Post
attr_accessor :published, :public, :deleted
@@ -72,6 +72,7 @@ def my_attributes
end
it "should nest descriptions" do
+ #self.class.describe_subject_attributes.should == "blah"
self.class.description.should == "MyPost when published is true and public is false"
end
View
5 remarkable_datamapper/spec/spec_helper.rb
@@ -22,6 +22,11 @@
gem 'dm-validations', DM_VERSION
require 'dm-validations'
+gem 'svenfuchs-i18n'
+require 'i18n'
+
+require 'pp' # DEBUG ONLY
+
ENV['SQLITE3_SPEC_URI'] ||= 'sqlite3::memory:'
ENV['ADAPTER'] = 'sqlite3'
Please sign in to comment.
Something went wrong with that request. Please try again.