sunspot_test 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY +3 -0
- data/README.rdoc +16 -0
- data/VERSION +1 -1
- data/lib/sunspot_test.rb +1 -2
- data/lib/sunspot_test/test_unit.rb +4 -0
- data/spec/sunspot_test_spec.rb +1 -1
- data/sunspot_test.gemspec +4 -3
- metadata +14 -32
data/HISTORY
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
0.4.0 - September 13, 2011
|
2
|
+
* Added support for Test::Unit (thanks ordinaryzelig)
|
3
|
+
* Fix to use an existing server (thanks mattscilipoti)
|
1
4
|
0.3.2 - August 4, 2011
|
2
5
|
* Fixing bug where a server was launched multiple times (thanks aaronjenson and daniel-g)
|
3
6
|
0.3.1 - June 11, 2011
|
data/README.rdoc
CHANGED
@@ -49,6 +49,22 @@ Then within your specs, you'll need to tag and explicitly commit changes to solr
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
== Can it do TestUnit?
|
53
|
+
|
54
|
+
Same as RSpec.
|
55
|
+
|
56
|
+
In test_helper.rb
|
57
|
+
|
58
|
+
require 'sunspot_test/test_unit'
|
59
|
+
|
60
|
+
Then within your test, you'll need to tag and explicitly commit changes to solr:
|
61
|
+
|
62
|
+
test 'searching' do
|
63
|
+
book = Factory(:book, :title => "Of Mice and Men")
|
64
|
+
Sunspot.commit
|
65
|
+
assert_equal [book], Book.search { keywords "mice"}.results
|
66
|
+
end
|
67
|
+
|
52
68
|
== Configuring the timeout
|
53
69
|
|
54
70
|
The test suite will try and launch a solr process and wait for 15 seconds for the process to launch. You can configure this timeout by setting the following in env.rb:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/sunspot_test.rb
CHANGED
@@ -22,7 +22,7 @@ module SunspotTest
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def start_sunspot_server
|
25
|
-
unless
|
25
|
+
unless solr_running?
|
26
26
|
pid = fork do
|
27
27
|
STDERR.reopen("/dev/null")
|
28
28
|
STDOUT.reopen("/dev/null")
|
@@ -31,7 +31,6 @@ module SunspotTest
|
|
31
31
|
|
32
32
|
at_exit { Process.kill("TERM", pid) }
|
33
33
|
|
34
|
-
@running = true
|
35
34
|
wait_until_solr_starts
|
36
35
|
end
|
37
36
|
end
|
data/spec/sunspot_test_spec.rb
CHANGED
@@ -30,7 +30,7 @@ describe SunspotTest do
|
|
30
30
|
|
31
31
|
describe ".start_sunspot_server" do
|
32
32
|
context "if server is already started" do
|
33
|
-
before(:each) { SunspotTest.
|
33
|
+
before(:each) { SunspotTest.stub!(:solr_running? => true) }
|
34
34
|
|
35
35
|
it "does not try to spin up another server" do
|
36
36
|
Kernel.should_not_receive(:fork)
|
data/sunspot_test.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sunspot_test}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Zach Moazeni"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-09-15}
|
13
13
|
s.description = %q{Testing sunspot with cucumber can be a pain. This gem will automatically start/stop solr with cucumber scenarios tagged with @search}
|
14
14
|
s.email = %q{zach@collectiveidea.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,13 +28,14 @@ Gem::Specification.new do |s|
|
|
28
28
|
"lib/sunspot_test.rb",
|
29
29
|
"lib/sunspot_test/cucumber.rb",
|
30
30
|
"lib/sunspot_test/rspec.rb",
|
31
|
+
"lib/sunspot_test/test_unit.rb",
|
31
32
|
"spec/spec_helper.rb",
|
32
33
|
"spec/sunspot_test_spec.rb",
|
33
34
|
"sunspot_test.gemspec"
|
34
35
|
]
|
35
36
|
s.homepage = %q{https://github.com/collectiveidea/sunspot_test}
|
36
37
|
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = %q{1.
|
38
|
+
s.rubygems_version = %q{1.5.2}
|
38
39
|
s.summary = %q{Auto-starts solr for your cucumber tests}
|
39
40
|
|
40
41
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 2
|
10
|
-
version: 0.3.2
|
5
|
+
version: 0.4.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Zach Moazeni
|
@@ -15,52 +10,41 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
13
|
+
date: 2011-09-15 00:00:00 -04:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
type: :development
|
17
|
+
name: jeweler
|
24
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
19
|
none: false
|
26
20
|
requirements:
|
27
21
|
- - ">="
|
28
22
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
23
|
version: "0"
|
33
|
-
|
24
|
+
type: :development
|
25
|
+
prerelease: false
|
34
26
|
version_requirements: *id001
|
35
27
|
- !ruby/object:Gem::Dependency
|
36
|
-
|
37
|
-
type: :development
|
28
|
+
name: rspec
|
38
29
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
30
|
none: false
|
40
31
|
requirements:
|
41
32
|
- - ">="
|
42
33
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
|
-
segments:
|
45
|
-
- 0
|
46
34
|
version: "0"
|
47
|
-
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
48
37
|
version_requirements: *id002
|
49
38
|
- !ruby/object:Gem::Dependency
|
50
|
-
|
51
|
-
type: :runtime
|
39
|
+
name: sunspot_rails
|
52
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
41
|
none: false
|
54
42
|
requirements:
|
55
43
|
- - ">="
|
56
44
|
- !ruby/object:Gem::Version
|
57
|
-
hash: 29
|
58
|
-
segments:
|
59
|
-
- 1
|
60
|
-
- 2
|
61
|
-
- 1
|
62
45
|
version: 1.2.1
|
63
|
-
|
46
|
+
type: :runtime
|
47
|
+
prerelease: false
|
64
48
|
version_requirements: *id003
|
65
49
|
description: Testing sunspot with cucumber can be a pain. This gem will automatically start/stop solr with cucumber scenarios tagged with @search
|
66
50
|
email: zach@collectiveidea.com
|
@@ -83,6 +67,7 @@ files:
|
|
83
67
|
- lib/sunspot_test.rb
|
84
68
|
- lib/sunspot_test/cucumber.rb
|
85
69
|
- lib/sunspot_test/rspec.rb
|
70
|
+
- lib/sunspot_test/test_unit.rb
|
86
71
|
- spec/spec_helper.rb
|
87
72
|
- spec/sunspot_test_spec.rb
|
88
73
|
- sunspot_test.gemspec
|
@@ -100,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
85
|
requirements:
|
101
86
|
- - ">="
|
102
87
|
- !ruby/object:Gem::Version
|
103
|
-
hash:
|
88
|
+
hash: 3845911013123125803
|
104
89
|
segments:
|
105
90
|
- 0
|
106
91
|
version: "0"
|
@@ -109,14 +94,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
94
|
requirements:
|
110
95
|
- - ">="
|
111
96
|
- !ruby/object:Gem::Version
|
112
|
-
hash: 3
|
113
|
-
segments:
|
114
|
-
- 0
|
115
97
|
version: "0"
|
116
98
|
requirements: []
|
117
99
|
|
118
100
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.5.2
|
120
102
|
signing_key:
|
121
103
|
specification_version: 3
|
122
104
|
summary: Auto-starts solr for your cucumber tests
|