guard-puma 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3409b8002deff9254b9f600173fcbec6a6a8714a
4
- data.tar.gz: d8c9a7385eca03d2a2224f2c05ca3ab1da984de1
3
+ metadata.gz: 036598d285f6aa1103ccf4e48abb0c58e66530c1
4
+ data.tar.gz: 1ebf5c56e2076d16d9aacb1f7bfe0cf37957ae3c
5
5
  SHA512:
6
- metadata.gz: 653fa2730fa0bc143c1f6b7f757655cbb41d91ebeec1410d72589222ab3f9d0790918cf11664ea3c2a02fcac066992024f386e042d8883add2d053681ecdfb2e
7
- data.tar.gz: 919ba1cd1c3f76981989ff484c870516a39ad57d32f0e5085899da890c8edecd74538c8053eb5c2232d7ffaeccd5196ae4df9a530ecb0bcc13aad23720f2738e
6
+ metadata.gz: 83f78820ab526fd80559a5db1626934b5f39731353970cd24527edc5a0e23a6e8d11858392311b7e3512064033be3389dcf31395deaa6eb62716d65928cf00b8
7
+ data.tar.gz: 7e72cb3b760f031f1a8044c5dd916faa8afde30d6454284933ecbf19932b427d0997a4502854dc9a766cdf5ada043fee6d174df1406d264d812b4a854bc0dab3
@@ -4,3 +4,4 @@ rvm:
4
4
  - 2.1.2
5
5
  - rbx-2
6
6
  - jruby-19mode
7
+ install: bundle install --retry=3
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 0.3.1
4
+
5
+ * Update RSpec to 3.1.0+
6
+ * Fix Travis CI builds on Rubinius
7
+
3
8
  ## 0.3.0
4
9
 
5
10
  * Depend on rake 10.2+
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.add_dependency "guard", "~> 2.8"
17
17
  gem.add_dependency "puma"
18
18
  gem.add_development_dependency "rake", "~> 10.2"
19
- gem.add_development_dependency "rspec", "~> 2.14.0"
20
- gem.add_development_dependency "guard-rspec", "~> 0.7.0"
19
+ gem.add_development_dependency "rspec", "~> 3.1.0"
20
+ gem.add_development_dependency "guard-rspec", "~> 4.3.0"
21
21
  gem.add_development_dependency "pry"
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module PumaVersion
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -11,18 +11,18 @@ describe Guard::PumaRunner do
11
11
 
12
12
  describe "#initialize" do
13
13
  it "sets options" do
14
- runner.options.should eq(options)
14
+ expect(runner.options).to eq(options)
15
15
  end
16
16
  end
17
17
 
18
18
  %w(halt restart).each do |cmd|
19
19
  describe cmd do
20
20
  before do
21
- runner.stub(:build_uri).with(cmd).and_return(uri)
21
+ allow(runner).to receive(:build_uri).with(cmd).and_return(uri)
22
22
  end
23
23
  let(:uri) { URI("http://#{runner.control_url}/#{cmd}?token=#{runner.control_token}") }
24
24
  it "#{cmd}s" do
25
- Net::HTTP.should_receive(:get).with(uri).once
25
+ expect(Net::HTTP).to receive(:get).with(uri).once
26
26
  runner.send(cmd.intern)
27
27
  end
28
28
  end
@@ -34,7 +34,7 @@ describe Guard::PumaRunner do
34
34
  let(:options) { default_options.merge(:timeout => timeout) }
35
35
 
36
36
  it "adjusts the sleep time as necessary" do
37
- runner.sleep_time.should == (timeout.to_f / Guard::PumaRunner::MAX_WAIT_COUNT.to_f)
37
+ expect(runner.sleep_time).to eq(timeout.to_f / Guard::PumaRunner::MAX_WAIT_COUNT.to_f)
38
38
  end
39
39
  end
40
40
 
@@ -46,7 +46,7 @@ describe Guard::PumaRunner do
46
46
  let(:options) {{ :config => path }}
47
47
  let(:path) { "/tmp/elephants" }
48
48
  it "adds path to command" do
49
- runner.cmd_opts.should match("--config #{path}")
49
+ expect(runner.cmd_opts).to match("--config #{path}")
50
50
  end
51
51
  end
52
52
 
@@ -54,7 +54,7 @@ describe Guard::PumaRunner do
54
54
  let(:options) {{ :bind => uri }}
55
55
  let(:uri) { "tcp://foo" }
56
56
  it "adds uri option to command" do
57
- runner.cmd_opts.should match("--bind #{uri}")
57
+ expect(runner.cmd_opts).to match("--bind #{uri}")
58
58
  end
59
59
  end
60
60
 
@@ -62,7 +62,7 @@ describe Guard::PumaRunner do
62
62
  let(:options) {{ :control_token => token }}
63
63
  let(:token) { "imma-token" }
64
64
  it "adds token to command" do
65
- runner.cmd_opts.should match(/--control-token #{token}/)
65
+ expect(runner.cmd_opts).to match(/--control-token #{token}/)
66
66
  end
67
67
  end
68
68
 
@@ -70,7 +70,7 @@ describe Guard::PumaRunner do
70
70
  let(:options) {{ :threads => threads }}
71
71
  let(:threads) { "13:42" }
72
72
  it "adds path to command" do
73
- runner.cmd_opts.should match("--threads #{threads}")
73
+ expect(runner.cmd_opts).to match("--threads #{threads}")
74
74
  end
75
75
  end
76
76
  end
@@ -9,38 +9,45 @@ describe Guard::Puma do
9
9
  it "initializes with options" do
10
10
  guard
11
11
 
12
- guard.runner.options[:port].should == 4000
12
+ expect(guard.runner.options[:port]).to eq(4000)
13
13
  end
14
14
  end
15
15
 
16
16
  describe "#default_env" do
17
+ before do
18
+ @rack_env = ENV['RACK_ENV']
19
+ end
20
+
17
21
  context "when RACK_ENV is set" do
18
22
  before do
19
- @rack_env = ENV['RACK_ENV']
23
+ ENV['RACK_ENV'] = 'IAMGROOT'
20
24
  end
21
25
 
22
26
  it "uses the value of RACK_ENV" do
23
- ENV['RACK_ENV'] = 'production'
24
- Guard::Puma.default_env.should == 'production'
25
- end
26
-
27
- after do
28
- ENV['RACK_ENV'] = @rack_env
27
+ expect(Guard::Puma.default_env).to eq('IAMGROOT')
29
28
  end
30
29
  end
31
30
 
32
31
  context "when RACK_ENV is not set" do
32
+ before do
33
+ ENV.delete('RACK_ENV')
34
+ end
35
+
33
36
  it "defaults to development" do
34
- Guard::Puma.default_env.should == 'development'
37
+ expect(Guard::Puma.default_env).to eq('development')
35
38
  end
36
39
  end
40
+
41
+ after do
42
+ ENV['RACK_ENV'] = @rack_env
43
+ end
37
44
  end
38
45
 
39
46
  describe '#start' do
40
47
 
41
48
  context 'start on start' do
42
49
  it "runs startup" do
43
- guard.should_receive(:start).once
50
+ expect(guard).to receive(:start).once
44
51
  guard.start
45
52
  end
46
53
  end
@@ -49,7 +56,7 @@ describe Guard::Puma do
49
56
  let(:options) { { :start_on_start => false } }
50
57
 
51
58
  it "shows the right message and not run startup" do
52
- guard.runner.should_receive(:start).never
59
+ expect(guard.runner).to receive(:start).never
53
60
  guard.start
54
61
  end
55
62
  end
@@ -58,16 +65,16 @@ describe Guard::Puma do
58
65
  describe '#reload' do
59
66
 
60
67
  before do
61
- Guard::UI.should_receive(:info).with('Restarting Puma...')
62
- Guard::Notifier.should_receive(:notify).with(/Puma restarting/, hash_including(:image => :pending))
63
- guard.runner.stub(:restart).and_return(true)
68
+ expect(Guard::UI).to receive(:info).with('Restarting Puma...')
69
+ expect(Guard::Notifier).to receive(:notify).with(/Puma restarting/, hash_including(:image => :pending))
70
+ allow(guard.runner).to receive(:restart).and_return(true)
64
71
  end
65
72
 
66
- let(:runner_stub) { Guard::PumaRunner.any_instance.stub(:halt) }
73
+ let(:runner_stub) { allow_any_instance_of(Guard::PumaRunner).to receive(:halt) }
67
74
 
68
75
  it "restarts and show the message" do
69
- Guard::UI.should_receive(:info)
70
- Guard::Notifier.should_receive(:notify).with(/Puma restarted/, hash_including(:image => :success))
76
+ expect(Guard::UI).to receive(:info)
77
+ expect(Guard::Notifier).to receive(:notify).with(/Puma restarted/, hash_including(:image => :success))
71
78
 
72
79
  guard.reload
73
80
  end
@@ -76,15 +83,15 @@ describe Guard::Puma do
76
83
 
77
84
  describe '#stop' do
78
85
  it "stops correctly" do
79
- Guard::Notifier.should_receive(:notify).with('Until next time...', anything)
80
- guard.runner.should_receive(:halt).once
86
+ expect(Guard::Notifier).to receive(:notify).with('Until next time...', anything)
87
+ expect(guard.runner).to receive(:halt).once
81
88
  guard.stop
82
89
  end
83
90
  end
84
91
 
85
92
  describe '#run_on_change' do
86
93
  it "reloads on change" do
87
- guard.should_receive(:reload).once
94
+ expect(guard).to receive(:reload).once
88
95
  guard.run_on_change([])
89
96
  end
90
97
  end
@@ -8,7 +8,6 @@ ENV["GUARD_ENV"] = 'test'
8
8
  require 'rspec'
9
9
 
10
10
  RSpec.configure do |config|
11
- config.treat_symbols_as_metadata_keys_with_true_values = true
12
11
  config.run_all_when_everything_filtered = true
13
12
  config.filter_run :focus
14
13
  config.mock_with :rspec
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Cooke
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.14.0
61
+ version: 3.1.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.14.0
68
+ version: 3.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.7.0
75
+ version: 4.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.7.0
82
+ version: 4.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement