specjour 0.3.0.rc5 → 0.3.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -21,3 +21,5 @@ pkg
21
21
  ## PROJECT::SPECIFIC
22
22
  .specjour
23
23
  spec/spec.opts
24
+ .bundle
25
+ Gemfile.lock
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm gemset use specjour
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source :rubygems
2
+ gemspec
data/History.markdown CHANGED
@@ -1,6 +1,13 @@
1
1
  History
2
2
  =======
3
3
 
4
+ ## 0.3.0.rc6 / 2010-08-07
5
+
6
+ * [fixed] Ruby 1.9.2 support through minor changes and DNSSD upgrade
7
+ * [fixed] DbScrub.drop actually invokes the db:drop rake task
8
+ * [fixed] Prepare task ignores rspec's at_exit callback, disabling the test
9
+ suite from running after the prepare task completes.
10
+
4
11
  ## 0.3.0.rc5 / 2010-07-30
5
12
 
6
13
  * [fixed] Shared example groups now supported in Rspec2
data/README.markdown CHANGED
@@ -13,6 +13,8 @@
13
13
  Running `specjour` starts a dispatcher, a manager, and multiple workers - all
14
14
  of the componenets necessary for distributing your test suite.
15
15
 
16
+ _(Read the Rails section first if your project uses Rails)_
17
+
16
18
  $ cd myproject
17
19
  $ specjour
18
20
 
@@ -45,6 +47,8 @@ Each worker should run their specs in an isolated database. Modify the test data
45
47
  test:
46
48
  database: blog_test<%=ENV['TEST_ENV_NUMBER']%>
47
49
 
50
+ Running `specjour prepare` will set up the database for each worker.
51
+
48
52
  ### ActiveRecord Hooks
49
53
  Specjour contains ActiveRecord hooks that clear database tables before running tests using `DELETE FROM <table_name>;`. Additionally, test databases will be created if they don't exist (i.e. `CREATE DATABASE blog_test8` for the 8th worker) and your schema will be loaded when the database is out of date.
50
54
 
@@ -68,7 +72,7 @@ test suite, override it with a custom after\_fork hook.
68
72
 
69
73
  A preparation hook is run when `specjour prepare` is invoked. This hook allows
70
74
  you to run arbitrary code on all of the listening workers. By default, it drops
71
- and recreates the database on all workers.
75
+ and recreates the ActiveRecord database on all workers.
72
76
 
73
77
  # .specjour/hooks.rb
74
78
 
@@ -77,11 +81,6 @@ and recreates the database on all workers.
77
81
  # custom preparation code
78
82
  end
79
83
 
80
- ## Only listen to supported projects
81
- By default, a manager will listen to the project in the current directory. If you want to listen for multiple projects, use the `--projects` flag.
82
-
83
- $ specjour listen --projects bizconf workbeast # run specs for the bizconf and workbeast projects
84
-
85
84
  ## Customize what gets rsync'd
86
85
  The standard rsync configuration file may be too broad for your
87
86
  project. If you find you're rsyncing gigs of extraneous data from your public
@@ -89,6 +88,20 @@ directory, add an exclusion to your projects rsyncd.conf file.
89
88
 
90
89
  $ vi workbeast/.specjour/rsyncd.conf
91
90
 
91
+ ## Listen for multiple projects
92
+ By default, a manager will listen to the project in the current directory. If you want to listen for multiple projects, use the `--projects` flag.
93
+
94
+ $ specjour listen --projects bizconf workbeast # run specs for the bizconf and workbeast projects
95
+
96
+ ## Give your project an alias
97
+ By default, the dispatcher looks for managers matching the project's directory name. If you have multiple teams working on different branches of the same project you may want to isolate each specjour cluster. Give your project an alias and only listen for that alias.
98
+
99
+ ~/bizconf $ specjour listen -p bizconf_08
100
+ ~/bizconf $ specjour -a bizconf_08
101
+
102
+ ~/bizconf $ specjour listen -p bizconf_09
103
+ ~/bizconf $ specjour -a bizconf_09
104
+
92
105
  ## Thanks
93
106
 
94
107
  * shayarnett - Cucumber support, pairing and other various patches
data/Rakefile CHANGED
@@ -10,11 +10,12 @@ begin
10
10
  gem.email = "sandro.turriate@gmail.com"
11
11
  gem.homepage = "http://github.com/sandro/specjour"
12
12
  gem.authors = ["Sandro Turriate"]
13
- gem.add_dependency "dnssd", "1.3.1"
14
- gem.add_dependency "thor", ">=0.13.4"
13
+ gem.add_dependency "dnssd", "1.3.4"
14
+ gem.add_dependency "thor", ">=0.14.0"
15
15
  gem.add_development_dependency "rspec", "1.3.0"
16
16
  gem.add_development_dependency "rr", ">=0.10.11"
17
17
  gem.add_development_dependency "yard", ">=0.5.3"
18
+ gem.add_development_dependency "jeweler", ">=1.4.0"
18
19
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
20
  end
20
21
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0.rc5
1
+ 0.3.0.rc6
data/lib/specjour/cli.rb CHANGED
@@ -2,10 +2,6 @@ module Specjour
2
2
  require 'thor'
3
3
  class CLI < Thor
4
4
 
5
- def self.printable_tasks
6
- super.reject{|t| t.last =~ /INTERNAL USE/ }
7
- end
8
-
9
5
  def self.worker_option
10
6
  method_option :workers, :aliases => "-w", :type => :numeric, :desc => "Number of concurent processes to run. Defaults to your system's available cores."
11
7
  end
@@ -62,7 +58,7 @@ module Specjour
62
58
  puts Specjour::VERSION
63
59
  end
64
60
 
65
- desc "work", "INTERNAL USE ONLY"
61
+ desc "work", "INTERNAL USE ONLY", :hide => true
66
62
  method_option :project_path, :required => true
67
63
  method_option :printer_uri, :required => true
68
64
  method_option :number, :type => :numeric, :required => true
@@ -13,7 +13,7 @@ module Specjour
13
13
  extend self
14
14
 
15
15
  def drop
16
- Rake::Task['db:drop']
16
+ Rake::Task['db:drop'].invoke
17
17
  end
18
18
 
19
19
  def scrub
@@ -38,15 +38,17 @@ module Specjour
38
38
  end
39
39
 
40
40
  def all_specs(tests_path = 'spec')
41
- Dir.chdir(project_path) do
42
- Dir[File.join(tests_path, "**/*_spec.rb")].sort
43
- end if File.exists? File.join(project_path, tests_path)
41
+ full_path = File.join(project_path, tests_path)
42
+ if File.exists? full_path
43
+ Dir[File.join(full_path, "**/*_spec.rb")].sort
44
+ end
44
45
  end
45
46
 
46
47
  def all_features(tests_path = 'features')
47
- Dir.chdir(project_path) do
48
- Dir[File.join(tests_path, "**/*.feature")].sort
49
- end if File.exists? File.join(project_path, tests_path)
48
+ full_path = File.join(project_path, tests_path)
49
+ if File.exists? full_path
50
+ Dir[File.join(full_path, "**/*.feature")].sort
51
+ end
50
52
  end
51
53
 
52
54
  def add_manager(manager)
@@ -147,6 +149,7 @@ module Specjour
147
149
 
148
150
  def resolve_reply(reply)
149
151
  DNSSD.resolve!(reply) do |resolved|
152
+ Specjour.logger.debug "Bonjour discovered #{resolved.target}"
150
153
  resolved_ip = ip_from_hostname(resolved.target)
151
154
  uri = URI::Generic.build :scheme => reply.service_name, :host => resolved_ip, :port => resolved.port
152
155
  fetch_manager(uri)
@@ -64,7 +64,7 @@ module Specjour::Rspec
64
64
  protected
65
65
 
66
66
  def print_and_flush(messages)
67
- output.print messages.to_s
67
+ output.print messages.join
68
68
  output.flush
69
69
  messages.replace []
70
70
  end
@@ -29,6 +29,7 @@ module Specjour
29
29
  def prepare
30
30
  load_app
31
31
  Configuration.prepare.call
32
+ Kernel.exit!
32
33
  end
33
34
 
34
35
  def run_tests
@@ -62,7 +63,11 @@ module Specjour
62
63
  Rspec::Preloader.load(preload_spec) if preload_spec
63
64
  Cucumber::Preloader.load(preload_feature) if preload_feature
64
65
  rescue StandardError => exception
65
- $stderr.puts "Caught exception: #{exception.class} #{exception.message}\nProceeding..."
66
+ msg = [
67
+ "Caught exception: #{exception.class} #{exception.message}",
68
+ "Proceeding... you may need to re-run the dispatcher."
69
+ ]
70
+ $stderr.puts msg.join("\n")
66
71
  end
67
72
 
68
73
  def printer_connection
data/lib/specjour.rb CHANGED
@@ -28,7 +28,7 @@ module Specjour
28
28
  autoload :Cucumber, 'specjour/cucumber'
29
29
  autoload :Rspec, 'specjour/rspec'
30
30
 
31
- VERSION = "0.3.0.rc5".freeze
31
+ VERSION = "0.3.0.rc6".freeze
32
32
  HOOKS_PATH = ".specjour/hooks.rb"
33
33
 
34
34
  class << self
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Specjour::CLI do
4
+ subject { Specjour::CLI.new }
4
5
  let(:fake_pid) { 100_000_000 }
5
6
  before do
6
7
  stub(Specjour::CPU).cores.returns(27)
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Specjour::Manager do
4
4
  describe "#available_for?" do
5
+ subject { Specjour::Manager.new }
5
6
  it "isn't available for all projects by default" do
6
7
  subject.available_for?(rand.to_s).should be_false
7
8
  end
@@ -8,7 +8,9 @@ def boo
8
8
  end
9
9
 
10
10
  describe Specjour do
11
- it "pends as an example"
11
+ it "pends as an example" do
12
+ pending
13
+ end
12
14
 
13
15
  it "fails as an example" do
14
16
  boo
data/specjour.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{specjour}
8
- s.version = "0.3.0.rc5"
8
+ s.version = "0.3.0.rc6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sandro Turriate"]
12
- s.date = %q{2010-07-30}
12
+ s.date = %q{2010-09-07}
13
13
  s.default_executable = %q{specjour}
14
14
  s.description = %q{Distribute your spec suite amongst your LAN via Bonjour.}
15
15
  s.email = %q{sandro.turriate@gmail.com}
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
21
21
  ".dev",
22
22
  ".document",
23
23
  ".gitignore",
24
+ ".rvmrc",
25
+ "Gemfile",
24
26
  "History.markdown",
25
27
  "MIT_LICENSE",
26
28
  "README.markdown",
@@ -87,24 +89,27 @@ Gem::Specification.new do |s|
87
89
  s.specification_version = 3
88
90
 
89
91
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
90
- s.add_runtime_dependency(%q<dnssd>, ["= 1.3.1"])
91
- s.add_runtime_dependency(%q<thor>, [">= 0.13.4"])
92
+ s.add_runtime_dependency(%q<dnssd>, ["= 1.3.4"])
93
+ s.add_runtime_dependency(%q<thor>, [">= 0.14.0"])
92
94
  s.add_development_dependency(%q<rspec>, ["= 1.3.0"])
93
95
  s.add_development_dependency(%q<rr>, [">= 0.10.11"])
94
96
  s.add_development_dependency(%q<yard>, [">= 0.5.3"])
97
+ s.add_development_dependency(%q<jeweler>, [">= 1.4.0"])
95
98
  else
96
- s.add_dependency(%q<dnssd>, ["= 1.3.1"])
97
- s.add_dependency(%q<thor>, [">= 0.13.4"])
99
+ s.add_dependency(%q<dnssd>, ["= 1.3.4"])
100
+ s.add_dependency(%q<thor>, [">= 0.14.0"])
98
101
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
99
102
  s.add_dependency(%q<rr>, [">= 0.10.11"])
100
103
  s.add_dependency(%q<yard>, [">= 0.5.3"])
104
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
101
105
  end
102
106
  else
103
- s.add_dependency(%q<dnssd>, ["= 1.3.1"])
104
- s.add_dependency(%q<thor>, [">= 0.13.4"])
107
+ s.add_dependency(%q<dnssd>, ["= 1.3.4"])
108
+ s.add_dependency(%q<thor>, [">= 0.14.0"])
105
109
  s.add_dependency(%q<rspec>, ["= 1.3.0"])
106
110
  s.add_dependency(%q<rr>, [">= 0.10.11"])
107
111
  s.add_dependency(%q<yard>, [">= 0.5.3"])
112
+ s.add_dependency(%q<jeweler>, [">= 1.4.0"])
108
113
  end
109
114
  end
110
115
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specjour
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940562
4
+ hash: 977940563
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
9
  - 0
10
- - rc5
11
- version: 0.3.0.rc5
10
+ - rc6
11
+ version: 0.3.0.rc6
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sandro Turriate
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-30 00:00:00 -04:00
19
+ date: 2010-09-07 00:00:00 -04:00
20
20
  default_executable: specjour
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -27,12 +27,12 @@ dependencies:
27
27
  requirements:
28
28
  - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 25
30
+ hash: 19
31
31
  segments:
32
32
  - 1
33
33
  - 3
34
- - 1
35
- version: 1.3.1
34
+ - 4
35
+ version: 1.3.4
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
@@ -43,12 +43,12 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- hash: 35
46
+ hash: 39
47
47
  segments:
48
48
  - 0
49
- - 13
50
- - 4
51
- version: 0.13.4
49
+ - 14
50
+ - 0
51
+ version: 0.14.0
52
52
  type: :runtime
53
53
  version_requirements: *id002
54
54
  - !ruby/object:Gem::Dependency
@@ -99,6 +99,22 @@ dependencies:
99
99
  version: 0.5.3
100
100
  type: :development
101
101
  version_requirements: *id005
102
+ - !ruby/object:Gem::Dependency
103
+ name: jeweler
104
+ prerelease: false
105
+ requirement: &id006 !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ hash: 7
111
+ segments:
112
+ - 1
113
+ - 4
114
+ - 0
115
+ version: 1.4.0
116
+ type: :development
117
+ version_requirements: *id006
102
118
  description: Distribute your spec suite amongst your LAN via Bonjour.
103
119
  email: sandro.turriate@gmail.com
104
120
  executables:
@@ -111,6 +127,8 @@ files:
111
127
  - .dev
112
128
  - .document
113
129
  - .gitignore
130
+ - .rvmrc
131
+ - Gemfile
114
132
  - History.markdown
115
133
  - MIT_LICENSE
116
134
  - README.markdown