subelsky_power_tools 1.2.7 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 351af5ba832e2d4afca0cb5e19ad2649b6c178c4
4
+ data.tar.gz: 9553f91211a77544e09c3b34e5e83903e6af63ad
5
+ SHA512:
6
+ metadata.gz: 218492f3ec1d1170d19afea5253584c48e4ca54e1567fd9c18e12f7024edfd677b5ccf57bfc52426281dd934ae7f57f3ff9fa726c7cbe010f9e678aed3d5d435
7
+ data.tar.gz: d1d4cde0238f66e3f36a9a5b4ecd8864a99cdcf734c697231984446bc7fdc393f71d3fdd98d5d611b14bd9581cd7a7f74d7842a212dd635b945b177f186b5245
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
+ Gemfile.lock
1
2
  *.gem
data/.rspec CHANGED
@@ -1,3 +1 @@
1
1
  --colour
2
- --drb
3
- --drb-port 9501
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0
data/Gemfile CHANGED
@@ -1,8 +1,3 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
  gemspec
3
-
4
- group :test do
5
- gem "growl"
6
- gem "guard-spork"
7
- gem "guard-rspec"
8
- end
3
+ gem "transpec"
data/Rakefile CHANGED
@@ -17,5 +17,5 @@ task :release do
17
17
  `git tag '#{SubelskyPowerTools::VERSION}'`
18
18
  `git push origin '#{SubelskyPowerTools::VERSION}'`
19
19
  `gem build subelsky_power_tools.gemspec`
20
- `gem push subelsky_power_tools-#{SubelskyPowerTools::VERSION}`
20
+ `gem push subelsky_power_tools-#{SubelskyPowerTools::VERSION}.gem`
21
21
  end
@@ -1,13 +1,16 @@
1
+ # MyWorker.should have_queued_job(2)
2
+ # Collector.should have_queued_job_at(Time.new(2012,1,23,14,00),2)
3
+
1
4
  RSpec::Matchers.define :have_queued_job do |*expected|
2
5
  match do |actual|
3
- actual.jobs.any? { |job| job["args"] == Array(expected) }
6
+ actual.jobs.any? { |job| Array(expected) == job["args"] }
4
7
  end
5
8
 
6
- failure_message_for_should do |actual|
9
+ failure_message do |actual|
7
10
  "expected that #{actual} would have a job queued with #{expected}"
8
11
  end
9
12
 
10
- failure_message_for_should_not do |actual|
13
+ failure_message_when_negated do |actual|
11
14
  "expected that #{actual} would not a have a job queued with #{expected}"
12
15
  end
13
16
 
@@ -1,3 +1,3 @@
1
1
  module SubelskyPowerTools
2
- VERSION = "1.2.7"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -27,8 +27,8 @@ describe SubelskyPowerTools::Environment do
27
27
 
28
28
  it "returns the value of the extracted variables" do
29
29
  val1, val2 = conduct_test("alpha","beta")
30
- val1.should == "alpha"
31
- val2.should == "beta"
30
+ expect(val1).to eq("alpha")
31
+ expect(val2).to eq("beta")
32
32
  end
33
33
  end
34
34
 
@@ -53,8 +53,8 @@ describe SubelskyPowerTools::Environment do
53
53
 
54
54
  it "returns the value of the extracted variables" do
55
55
  val1, val2 = conduct_test(nil,"beta")
56
- val1.should == nil
57
- val2.should == "beta"
56
+ expect(val1).to eq(nil)
57
+ expect(val2).to eq("beta")
58
58
  end
59
59
  end
60
60
  end
@@ -14,5 +14,5 @@ describe ActiveRecord::Base do
14
14
  Widget = Class.new(ActiveRecord::Base)
15
15
  subject { Widget.new }
16
16
 
17
- its(:to_s) { should eq("Widget 50") }
17
+ specify { expect(subject.to_s).to eq("Widget 50") }
18
18
  end
@@ -6,7 +6,7 @@ describe Exception do
6
6
  begin
7
7
  raise StandardError.new("something bad happened")
8
8
  rescue StandardError => e
9
- e.detail.should =~ /StandardError: something bad happened\n/
9
+ expect(e.detail).to match(/StandardError: something bad happened\n/)
10
10
  end
11
11
  end
12
12
  end
@@ -8,23 +8,23 @@ describe Hash do
8
8
  end
9
9
 
10
10
  it "should except given keys" do
11
- h.except(:a).should == { :b => 2, :c => 3 }
12
- h.except(:a,:c).should == { :b => 2 }
11
+ expect(h.except(:a)).to eq({ :b => 2, :c => 3 })
12
+ expect(h.except(:a,:c)).to eq({ :b => 2 })
13
13
  end
14
14
 
15
15
  it "should perform destructive exceptions" do
16
- h.except!(:c).should == { :c => 3 }
17
- h.should == { :a => 1, :b => 2 }
16
+ expect(h.except!(:c)).to eq({ :c => 3 })
17
+ expect(h).to eq({ :a => 1, :b => 2 })
18
18
  h.except!(:a,:b)
19
- h.should be_empty
19
+ expect(h).to be_empty
20
20
  end
21
21
 
22
22
  it "should include given keys only" do
23
- h.only(:a,:b).should == { :a => 1, :b => 2 }
23
+ expect(h.only(:a,:b)).to eq({ :a => 1, :b => 2 })
24
24
  end
25
25
 
26
26
  it "should perform destructive inclusion" do
27
- h.only!(:c).should == { :a => 1, :b => 2}
28
- h.should == { :c => 3 }
27
+ expect(h.only!(:c)).to eq({ :a => 1, :b => 2})
28
+ expect(h).to eq({ :c => 3 })
29
29
  end
30
30
  end
@@ -13,7 +13,7 @@ describe "Kernel#retryable" do
13
13
  rescue ArgumentError
14
14
  end
15
15
 
16
- count.should == 3
16
+ expect(count).to eq(3)
17
17
  end
18
18
 
19
19
  it "reraises exceptions after exhausting all tries" do
@@ -24,7 +24,7 @@ describe "Kernel#retryable" do
24
24
 
25
25
  it "waits specified number of seconds between tries" do
26
26
  # this seems like a better way to measure sleep than using the clock
27
- Kernel.should_receive(:sleep).with(0.2).exactly(2).times
27
+ expect(Kernel).to receive(:sleep).with(0.2).exactly(2).times
28
28
 
29
29
  begin
30
30
  retryable(tries: 3,sleep: 0.2) { raise ArgumentError }
@@ -44,7 +44,7 @@ describe "Kernel#retryable" do
44
44
  49
45
45
  end
46
46
 
47
- result.should == 49
47
+ expect(result).to eq(49)
48
48
  end
49
49
 
50
50
  end
data/spec/spec_helper.rb CHANGED
@@ -1,32 +1,9 @@
1
- require "spork"
2
1
  $:.unshift(File.join(File.dirname(__FILE__),"..","lib"))
2
+ require "bundler/setup"
3
+ require "rspec"
3
4
 
4
- Spork.prefork do
5
- require "rspec"
6
-
7
- RSpec.configure do |config|
8
- config.mock_with :rspec
9
-
10
- last_gc_run = Time.now
11
-
12
- config.before(:each) do
13
- GC.disable
14
- end
15
-
16
- config.after(:each) do
17
- if Time.now - last_gc_run > 1.0
18
- GC.enable
19
- GC.start
20
- last_gc_run = Time.now
21
- end
22
- end
23
-
5
+ RSpec.configure do |config|
6
+ config.mock_with :rspec do |c|
7
+ c.syntax = :expect
24
8
  end
25
-
26
- require 'rspec/expectations'
27
- require 'rspec/core/expecting/with_rspec'
28
- end
29
-
30
- Spork.each_run do
31
- #load "subelsky_power_tools/ext/kernel.rb"
32
9
  end
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
14
14
  s.require_paths = ["lib"]
15
15
  s.summary = %q{This is a collection of Ruby extensions and utilities I've been carting around from project to project.}
16
16
  s.description = <<-DESC
17
- This is a collection of Ruby extensions and utilities I've been carting around from project to project.
17
+ This is a collection of Ruby extensions and utilities I've been carting around from project to project.
18
18
  Many are taken from the Facets project (I just don't want to include that whole gem in my codebases).
19
19
  DESC
20
20
  s.test_files = `git ls-files spec`.split("\n")
21
- s.add_development_dependency 'rspec'
21
+ s.add_development_dependency 'rspec', "~> 3.0"
22
22
  s.license = "MIT"
23
23
  end
metadata CHANGED
@@ -1,35 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subelsky_power_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.7
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mike Subelsky
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
11
+ date: 2014-06-07 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '3.0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
30
- description: ! "This is a collection of Ruby extensions and utilities I've been carting
31
- around from project to project. \nMany are taken from the Facets project (I just
32
- don't want to include that whole gem in my codebases).\n"
26
+ version: '3.0'
27
+ description: |
28
+ This is a collection of Ruby extensions and utilities I've been carting around from project to project.
29
+ Many are taken from the Facets project (I just don't want to include that whole gem in my codebases).
33
30
  email: mike@subelsky.com
34
31
  executables: []
35
32
  extensions: []
@@ -38,10 +35,9 @@ extra_rdoc_files:
38
35
  files:
39
36
  - .gitignore
40
37
  - .rspec
41
- - .rvmrc
38
+ - .ruby-version
42
39
  - CHANGELOG
43
40
  - Gemfile
44
- - Gemfile.lock
45
41
  - Guardfile
46
42
  - MIT-LICENSE
47
43
  - README.md
@@ -66,28 +62,27 @@ files:
66
62
  homepage: http://github.com/subelsky/subelsky_power_tools
67
63
  licenses:
68
64
  - MIT
65
+ metadata: {}
69
66
  post_install_message:
70
67
  rdoc_options:
71
68
  - --charset=UTF-8
72
69
  require_paths:
73
70
  - lib
74
71
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
72
  requirements:
77
- - - ! '>='
73
+ - - '>='
78
74
  - !ruby/object:Gem::Version
79
75
  version: '0'
80
76
  required_rubygems_version: !ruby/object:Gem::Requirement
81
- none: false
82
77
  requirements:
83
- - - ! '>='
78
+ - - '>='
84
79
  - !ruby/object:Gem::Version
85
80
  version: '0'
86
81
  requirements: []
87
82
  rubyforge_project:
88
- rubygems_version: 1.8.24
83
+ rubygems_version: 2.2.2
89
84
  signing_key:
90
- specification_version: 3
85
+ specification_version: 4
91
86
  summary: This is a collection of Ruby extensions and utilities I've been carting around
92
87
  from project to project.
93
88
  test_files:
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.2-p180-patched --create
data/Gemfile.lock DELETED
@@ -1,37 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- subelsky_power_tools (1.2.7)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- diff-lcs (1.1.2)
10
- growl (1.0.3)
11
- guard (0.4.2)
12
- thor (~> 0.14.6)
13
- guard-rspec (0.4.0)
14
- guard (>= 0.4.0)
15
- guard-spork (0.2.0)
16
- guard (>= 0.2.2)
17
- spork (>= 0.8.4)
18
- rspec (2.6.0)
19
- rspec-core (~> 2.6.0)
20
- rspec-expectations (~> 2.6.0)
21
- rspec-mocks (~> 2.6.0)
22
- rspec-core (2.6.4)
23
- rspec-expectations (2.6.0)
24
- diff-lcs (~> 1.1.2)
25
- rspec-mocks (2.6.0)
26
- spork (0.8.5)
27
- thor (0.14.6)
28
-
29
- PLATFORMS
30
- ruby
31
-
32
- DEPENDENCIES
33
- growl
34
- guard-rspec
35
- guard-spork
36
- rspec
37
- subelsky_power_tools!