Skip to content
Browse files

Shifting Sphinx checking spec into cucumber feature

  • Loading branch information...
1 parent 920c060 commit 2b6f874d38d9a55df713baa05e15408550dcd3fb @pat pat committed Dec 5, 2008
Showing with 32 additions and 15 deletions.
  1. +16 −0 features/sphinx_detection.feature
  2. +16 −0 features/steps/sphinx_steps.rb
  3. +0 −15 spec/unit/thinking_sphinx_spec.rb
View
16 features/sphinx_detection.feature
@@ -0,0 +1,16 @@
+Feature: Checking whether Sphinx is running or not
+ In order to avoid unnecessary errors
+ Thinking Sphinx
+ Should be able to determine whether Sphinx is running or not
+
+ Scenario: Deleting instances from the core index
+ Given Sphinx is running
+ Then Sphinx should be running
+
+ When I stop Sphinx
+ And I wait for Sphinx to catch up
+ Then Sphinx should not be running
+
+ When I start Sphinx
+ And I wait for Sphinx to catch up
+ Then Sphinx should be running
View
16 features/steps/sphinx_steps.rb
@@ -4,4 +4,20 @@
When "I wait for Sphinx to catch up" do
sleep(0.25)
+end
+
+When "I start Sphinx" do
+ ThinkingSphinx::Configuration.instance.controller.start
+end
+
+When "I stop Sphinx" do
+ ThinkingSphinx::Configuration.instance.controller.stop
+end
+
+Then "Sphinx should be running" do
+ ThinkingSphinx.sphinx_running?.should be_true
+end
+
+Then "Sphinx should not be running" do
+ ThinkingSphinx.sphinx_running?.should be_false
end
View
15 spec/unit/thinking_sphinx_spec.rb
@@ -126,19 +126,4 @@
end
end
end
-
- it "should detect if sphinx is running" do
- ThinkingSphinx.sphinx_running?.should be_false
-
- @sphinx.setup_sphinx
- @sphinx.start
- sleep(1)
-
- ThinkingSphinx.sphinx_running?.should be_true
-
- @sphinx.stop
- sleep(1)
-
- ThinkingSphinx.sphinx_running?.should be_false
- end
end

0 comments on commit 2b6f874

Please sign in to comment.
Something went wrong with that request. Please try again.