Skip to content

Commit 0d6abfc

Browse files
committed
Add some sample migrations, remove mocha
1 parent 1c8111b commit 0d6abfc

File tree

7 files changed

+39
-10
lines changed

7 files changed

+39
-10
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ end
2222
group :development, :test do
2323
gem "fabrication"
2424
gem "guard-rspec"
25-
gem "mocha"
2625
gem "rspec-rails"
2726
gem "spork", "~> 0.9.0.rc"
2827
end

Gemfile.lock

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: git://github.com/mongoid/evolver.git
3-
revision: 25e71ef2a51d759cddd0ce2c5349c17fd256f02f
3+
revision: e5910d1a8a17e24fd167b3c23064681a5b0782e0
44
specs:
55
evolver (0.0.0)
66
mongoid (~> 3.0)
@@ -101,10 +101,7 @@ GEM
101101
i18n (>= 0.4.0)
102102
mime-types (~> 1.16)
103103
treetop (~> 1.4.8)
104-
metaclass (0.0.1)
105104
mime-types (1.19)
106-
mocha (0.12.1)
107-
metaclass (~> 0.0.1)
108105
moped (1.1.5)
109106
multi_json (1.3.6)
110107
netrc (0.7.5)
@@ -192,7 +189,6 @@ DEPENDENCIES
192189
heroku
193190
jquery-rails
194191
jruby-openssl
195-
mocha
196192
mongoid!
197193
rails (~> 3.2)
198194
rspec-rails
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class AddDm
2+
include Evolver::Migration
3+
sessions :default
4+
5+
def execute
6+
session[:bands].insert({ name: "Depeche Mode" })
7+
end
8+
9+
def revert
10+
# Insert your code to revert the migration here.
11+
end
12+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class AddTool
2+
include Evolver::Migration
3+
sessions :default
4+
5+
def execute
6+
session[:bands].insert({ name: "Tool" })
7+
end
8+
9+
def revert
10+
# Insert your code to revert the migration here.
11+
end
12+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class AddPlacebo
2+
include Evolver::Migration
3+
sessions :default
4+
5+
def execute
6+
session[:bands].insert({ name: "Placebo" })
7+
end
8+
9+
def revert
10+
# Insert your code to revert the migration here.
11+
end
12+
end

spec/models/following_observer_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
end
2828

2929
it "tweets the following" do
30-
Facebook.expects(:post_to_wall).with(following).returns(true)
30+
Facebook.should_receive(:post_to_wall).with(following).and_return(true)
3131
observer.after_create(following)
3232
end
3333
end
@@ -39,7 +39,7 @@
3939
end
4040

4141
it "posts to the users facebook wall" do
42-
Twitter.expects(:tweet).with(following).returns(true)
42+
Twitter.should_receive(:tweet).with(following).and_return(true)
4343
observer.after_create(following)
4444
end
4545
end

spec/spec_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
Spork.each_run do
1616
RSpec.configure do |config|
17-
config.mock_with :mocha
18-
1917
# Clean up all collections before each spec runs.
2018
config.before do
2119
Mongoid.purge!

0 commit comments

Comments
 (0)