Skip to content

Commit

Permalink
better method name
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed May 12, 2011
1 parent a6d4ac5 commit ba29acb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here is an example RSpec 2 spec_helper.rb:
end
config.before :solr => true do
Sunspot::Rails::Tester.fork_original_sunspot_session
Sunspot::Rails::Tester.start_original_sunspot_session
Sunspot.session = $original_sunspot_session
Sunspot.remove_all!
end
Expand All @@ -34,7 +34,7 @@ Let's go through what the above code does.
* In the second `before` block, we use RSpec 2's metadata feature by
adding `:solr => true`. Any example or example group with this metadata
will run the _original_ sunspot session.
`Sunspot::Rails::Tester.fork_original_sunspot_session` starts the solr instance
`Sunspot::Rails::Tester.start_original_sunspot_session` starts the solr instance
if it's not running.

Here is an example spec that utilizes sunspot-rails-tester:
Expand Down
2 changes: 1 addition & 1 deletion lib/sunspot/rails/tester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class << self

attr_accessor :server, :started, :pid

def fork_original_sunspot_session
def start_original_sunspot_session
unless started?
self.server = Sunspot::Rails::Server.new
self.started = Time.now
Expand Down
8 changes: 4 additions & 4 deletions spec/sunspot/rails/tester_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Rails
describe Tester do
let(:tester) { described_class }

describe '.fork_original_sunspot_session' do
describe '.start_original_sunspot_session' do
let(:server) { double('sunspot_rails_server') }
let(:pid) { 5555 }

Expand All @@ -19,17 +19,17 @@ module Rails
after { tester.clear }

it 'sets the "server" attribute' do
tester.fork_original_sunspot_session
tester.start_original_sunspot_session
tester.server.should eq(server)
end

it 'sets the "started" attribute' do
tester.fork_original_sunspot_session
tester.start_original_sunspot_session
tester.started.should be_an_instance_of(Time)
end

it 'sets the "pid" attribute' do
tester.fork_original_sunspot_session
tester.start_original_sunspot_session
tester.pid.should eq(pid)
end
end
Expand Down

0 comments on commit ba29acb

Please sign in to comment.