Skip to content

Commit

Permalink
removed trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
etehtsea committed May 27, 2011
1 parent bc81ef2 commit da404f4
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/mongoid/dirty.rb
Expand Up @@ -243,7 +243,7 @@ module ClassMethods #:nodoc:
# person.title_was # "Sir"
# person.reset_title!
def add_dirty_methods(name)
define_method("#{name}_change") { attribute_change(name) } unless instance_methods.include?("#{name}_change") || instance_methods.include?(:"#{name}_change")
define_method("#{name}_change") { attribute_change(name) } unless instance_methods.include?("#{name}_change") || instance_methods.include?(:"#{name}_change")
define_method("#{name}_changed?") { attribute_changed?(name) } unless instance_methods.include?("#{name}_changed?") || instance_methods.include?(:"#{name}_changed?")
define_method("#{name}_was") { attribute_was(name) } unless instance_methods.include?("#{name}_was") || instance_methods.include?(:"#{name}_was")
define_method("reset_#{name}!") { reset_attribute!(name) } unless instance_methods.include?("reset_#{name}!") || instance_methods.include?(:"reset_#{name}!")
Expand Down
24 changes: 12 additions & 12 deletions spec/functional/mongoid/document_spec.rb
Expand Up @@ -698,50 +698,50 @@ class Manager < Person; end
Event.collection.drop
User.collection.drop
end

context "called on a reference_many object" do
before do
{'My birthday' => Date.new(1981, 2, 1), 'My cat`s birthday' => Date.new(1981, 2, 1),
{'My birthday' => Date.new(1981, 2, 1), 'My cat`s birthday' => Date.new(1981, 2, 1),
'My pidgeon`s birthday' => Date.new(1981, 2, 2) }.each do |title, date|
event = Event.new(:title => title, :date => date)
event.owner = @owner
event.save
end
end
end

let(:events) do
rounds = []
@owner.events.each_day(Date.new(1981, 1, 2), Date.new(1981, 2, 2)) do |date, collection|
rounds << {:date => date, :collection => collection}
end
rounds
end
end

it "should pass the block" do
events.length.should == 2
events.first[:collection].length.should == 2
events.last[:collection].length.should == 1
end
end

context "called on an embeds_many object" do
before do
{'My birthday' => Date.new(1981, 2, 1), 'My cat`s birthday' => Date.new(1981, 2, 1),
{'My birthday' => Date.new(1981, 2, 1), 'My cat`s birthday' => Date.new(1981, 2, 1),
'My pidgeon`s birthday' => Date.new(1981, 2, 2) }.each do |title, date|
birthday = Birthday.new(:title => title, :date => date)
birthday.owner = @owner
birthday.save
end
end
end

let(:birthdays) do
rounds = []
@owner.birthdays.each_day(Date.new(1981, 1, 2), Date.new(1981, 2, 2)) do |date, collection|
rounds << {:date => date, :collection => collection}
end
rounds
end
end

it "should pass the block" do
birthdays.length.should == 2
birthdays.first[:collection].length.should == 2
Expand Down
8 changes: 4 additions & 4 deletions spec/functional/mongoid/named_scope_spec.rb
Expand Up @@ -61,23 +61,23 @@
end

context "when an class attribute is defined" do

it "should be accessible" do
Person.somebody_elses_important_class_options.should == { :keep_me_around => true }
end

end

context "when calling scopes on parent classes" do

it "inherits the scope" do
Doctor.minor.should == []
end

it "inherits the class attribute methods" do
Doctor.somebody_elses_important_class_options.should == { :keep_me_around => true }
end

end
end
end
2 changes: 1 addition & 1 deletion spec/models/birthday.rb
Expand Up @@ -3,7 +3,7 @@ class Birthday
field :title
field :date, :type => Date
embedded_in :owner, :inverse_of => :birthdays

def self.each_day(start_date, end_date)
groups = only(:date).asc(:date).where(:date.gte => start_date, :date.lte => end_date).group
groups.each do |date, group|
Expand Down
2 changes: 1 addition & 1 deletion spec/models/event.rb
Expand Up @@ -9,7 +9,7 @@ class Event
:inverse_of => :administrated_events,
:dependent => :nullify
referenced_in :owner

def self.each_day(start_date, end_date)
groups = only(:date).asc(:date).where(:date.gte => start_date, :date.lte => end_date).group
groups.each do |hash|
Expand Down
6 changes: 3 additions & 3 deletions spec/models/ghost.rb
@@ -1,7 +1,7 @@
class Ghost
include Mongoid::Document

field :name, :type => String

referenced_in :movie, :autosave => true
end
end
4 changes: 2 additions & 2 deletions spec/unit/mongoid/collections/retry_spec.rb
Expand Up @@ -15,7 +15,7 @@ def do_action
"do something here"
end
end

subject { SomeCollection.new }

before do
Expand Down Expand Up @@ -103,4 +103,4 @@ def do_action
end
end
end
end
end
4 changes: 2 additions & 2 deletions spec/unit/mongoid/dirty_spec.rb
Expand Up @@ -483,7 +483,7 @@
end

describe "#initialization" do

context "when ::add_dirty_methods is called" do

let!(:method_list) do
Expand All @@ -503,7 +503,7 @@

Person.send(:add_dirty_methods, 'fieldname')
end

end

end
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/mongoid/extensions/symbol/conversions_spec.rb
@@ -1,7 +1,7 @@
require "spec_helper"

describe Mongoid::Extensions::Symbol::Conversions do

describe ".set" do
context "when given nil" do
it "returns nil" do
Expand All @@ -14,7 +14,7 @@
Symbol.set("").should be_nil
end
end

context "when given a symbol" do
it "returns the symbol" do
Symbol.set(:testing).should == :testing
Expand All @@ -32,7 +32,7 @@
it "returns a symbol" do
Symbol.get(:testing).should be_kind_of Symbol
end

it 'returns the same symbol' do
Symbol.get(:testing).should == :testing
end
Expand Down

0 comments on commit da404f4

Please sign in to comment.