Skip to content

Commit 80a10df

Browse files
Merge pull request #84 from sevenwire/hotfix/modernize
Hotfix/Modernize
2 parents 711a4b2 + 26894bc commit 80a10df

File tree

5 files changed

+60
-52
lines changed

5 files changed

+60
-52
lines changed

Gemfile.lock

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
PATH
22
remote: .
33
specs:
4-
forgery (0.6.0)
4+
forgery (0.7.0)
55

66
GEM
77
remote: https://rubygems.org/
88
specs:
9-
diff-lcs (1.2.5)
10-
rake (10.1.0)
11-
rspec (2.14.1)
12-
rspec-core (~> 2.14.0)
13-
rspec-expectations (~> 2.14.0)
14-
rspec-mocks (~> 2.14.0)
15-
rspec-core (2.14.8)
16-
rspec-expectations (2.14.5)
17-
diff-lcs (>= 1.1.3, < 2.0)
18-
rspec-mocks (2.14.6)
9+
diff-lcs (1.3)
10+
rake (12.3.0)
11+
rspec (3.7.0)
12+
rspec-core (~> 3.7.0)
13+
rspec-expectations (~> 3.7.0)
14+
rspec-mocks (~> 3.7.0)
15+
rspec-core (3.7.0)
16+
rspec-support (~> 3.7.0)
17+
rspec-expectations (3.7.0)
18+
diff-lcs (>= 1.2.0, < 2.0)
19+
rspec-support (~> 3.7.0)
20+
rspec-mocks (3.7.0)
21+
diff-lcs (>= 1.2.0, < 2.0)
22+
rspec-support (~> 3.7.0)
23+
rspec-support (3.7.0)
1924

2025
PLATFORMS
2126
ruby
2227

2328
DEPENDENCIES
24-
bundler (~> 1.3)
29+
bundler (~> 1.16.0)
2530
forgery!
2631
rake
2732
rspec
33+
34+
BUNDLED WITH
35+
1.16.0

forgery.gemspec

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# -*- encoding: utf-8 -*-
2-
$:.push File.expand_path("../lib", __FILE__)
3-
require "forgery/version"
1+
2+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
3+
require 'forgery/version'
44

55
Gem::Specification.new do |spec|
6-
spec.name = "forgery"
6+
spec.name = 'forgery'
77
spec.version = Forgery::VERSION
8-
spec.authors = ["Nathan Sutton", "Brandon Arbini", "Kamil Kieliszczyk"]
9-
10-
spec.homepage = "http://github.com/sevenwire/forgery"
11-
spec.summary = "Easy and customizable generation of forged data."
12-
spec.description = "Easy and customizable generation of forged data. Can be used as a gem or a rails plugin. Includes rails generators for creating your own forgeries."
8+
spec.authors = ['Nathan Sutton', 'Brandon Arbini', 'Kamil Kieliszczyk']
9+
10+
spec.homepage = 'http://github.com/sevenwire/forgery'
11+
spec.summary = 'Easy and customizable generation of forged data.'
12+
spec.description = 'Easy and customizable generation of forged data. Can be used as a gem or a rails plugin. Includes rails generators for creating your own forgeries.'
1313

1414
spec.platform = Gem::Platform::RUBY
15-
spec.required_rubygems_version = ">= 1.3.6"
16-
spec.rubyforge_project = "forgery"
15+
spec.required_rubygems_version = '>= 1.3.6'
16+
spec.rubyforge_project = 'forgery'
1717

18-
spec.files = `git ls-files`.split($/)
19-
spec.test_files = `git ls-files spec`.split($/)
20-
spec.require_paths = %w(lib)
18+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
19+
spec.test_files = `git ls-files spec`.split($INPUT_RECORD_SEPARATOR)
20+
spec.require_paths = %w[lib]
2121

22-
spec.add_development_dependency "bundler", "~> 1.3"
22+
spec.add_development_dependency 'bundler', '~> 1.16.0'
2323
end

lib/forgery/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Forgery
2-
VERSION = "0.6.0"
2+
VERSION = '0.7.0'.freeze
33
end

spec/extensions/range_spec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
require 'timeout'
33

44
describe Range do
5-
it "should get a random number out of the range" do
5+
it 'should get a random number out of the range' do
66
range = Forgery::Extend(0..9)
77
10.times { expect(range).to include(range.random) }
88
end
99

10-
it "should not take a long time when the range is huge" do
11-
expect {
12-
Timeout.timeout(1){Forgery::Extend(1234567890..12345678901234567890).random}
13-
}.not_to raise_error
10+
it 'should not take a long time when the range is huge' do
11+
expect do
12+
Timeout.timeout(1) { Forgery::Extend(1_234_567_890..12_345_678_901_234_567_890).random }
13+
end.not_to raise_error
1414
end
1515

16-
it "should return nil for a random number from a reverse range" do
16+
it 'should return nil for a random number from a reverse range' do
1717
10.times { expect(Forgery::Extend(9..0).random).to be_nil }
1818
end
1919

20-
it "should get a random string our of the range" do
21-
range = Forgery::Extend("a".."z")
20+
it 'should get a random string our of the range' do
21+
range = Forgery::Extend('a'..'z')
2222
10.times { expect(range).to include(range.random) }
2323
end
2424

25-
it "should return nil if the maximum is less than the minimum" do
26-
expect(Forgery::Extend("z".."a").random).to be_nil
25+
it 'should return nil if the maximum is less than the minimum' do
26+
expect(Forgery::Extend('z'..'a').random).to be_nil
2727
end
2828

29-
it "should not return the maximum at excluded range" do
30-
Random.should_receive(:rand).with(0...9).and_return(8)
31-
Forgery::Extend(0...9).random.should_not be_equal 9
29+
it 'should not return the maximum at excluded range' do
30+
expect(Random).to receive(:rand).with(0...9).and_return(8)
31+
expect(Forgery::Extend(0...9).random).to_not eq(9)
3232
end
3333
end

spec/forgery_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'pathname'
33

44
describe Forgery do
5-
it "should load a dictionary when it is requested" do
5+
it 'should load a dictionary when it is requested' do
66
Forgery.dictionaries.reset!
77

88
expect(Forgery.dictionaries).not_to be_loaded(:colors)
@@ -12,7 +12,7 @@
1212
expect(Forgery.dictionaries).to be_loaded(:colors)
1313
end
1414

15-
it "should load formats when it is requested" do
15+
it 'should load formats when it is requested' do
1616
Forgery.formats.reset!
1717

1818
expect(Forgery.formats).not_to be_loaded(:phone)
@@ -22,42 +22,42 @@
2222
expect(Forgery.formats).to be_loaded(:phone)
2323
end
2424

25-
it "should accept a symbol and return the appropriate forgery class" do
25+
it 'should accept a symbol and return the appropriate forgery class' do
2626
expect(Forgery(:address)).to eq(Forgery::Address)
2727
expect(Forgery(:basic)).to eq(Forgery::Basic)
2828
expect(Forgery(:internet)).to eq(Forgery::Internet)
2929
end
3030

31-
it "should accept two symbols, finding the right class and calling the appropriate method" do
31+
it 'should accept two symbols, finding the right class and calling the appropriate method' do
3232
expect(Forgery::Address).to receive(:street_name)
3333
Forgery(:address, :street_name)
3434

3535
expect(Forgery::Name).to receive(:full_name)
3636
Forgery(:name, :full_name)
3737
end
3838

39-
it "should accept two symbols and arguments, passing them along to the appropriate method" do
39+
it 'should accept two symbols and arguments, passing them along to the appropriate method' do
4040
expect(Forgery::LoremIpsum).to receive(:text).with(:sentences, 2)
4141
Forgery(:lorem_ipsum, :text, :sentences, 2)
4242
end
4343

44-
it "should return the rails root path as a string if Rails.root is defined" do
44+
it 'should return the rails root path as a string if Rails.root is defined' do
4545
Rails = Object.new
4646
allow(Rails).to receive(:root).and_return(Pathname.new('/path/from/rails/dot/root'))
4747
expect(Forgery.rails_root).to eq('/path/from/rails/dot/root')
4848
Object.instance_eval { remove_const(:Rails) }
4949
end
5050

51-
it "should return nil when Rails.root and Rails.root are not defined" do
51+
it 'should return nil when Rails.root and Rails.root are not defined' do
5252
expect(Forgery.rails_root).to be_nil
5353
end
5454

55-
it "should not be a rails environment when there is not a rails_root" do
56-
expect(Forgery.rails?).to be_false
55+
it 'should not be a rails environment when there is not a rails_root' do
56+
expect(Forgery.rails?).to be false
5757
end
5858

59-
it "should be a rails environment when there is a rails_root" do
59+
it 'should be a rails environment when there is a rails_root' do
6060
allow(Forgery).to receive(:rails?).and_return(true)
61-
expect(Forgery.rails?).to be_true
61+
expect(Forgery.rails?).to be true
6262
end
6363
end

0 commit comments

Comments
 (0)