Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Ruby 2.6.3 #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ engines:
enabled: false
rubocop:
enabled: true
channel: rubocop-0-67
reek:
enabled: true
checks:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.1
2.6.3
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ rvm:
- "2.3.7"
- "2.4.4"
- "2.5.1"
- "2.6.3"
script: bundle exec rspec
23 changes: 13 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GEM
i18n (1.1.1)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jaro_winkler (1.5.1)
jaro_winkler (1.5.2)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand All @@ -65,13 +65,13 @@ GEM
minitest (5.11.3)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
parser (2.5.1.2)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
psych (3.1.0)
rack (2.0.5)
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand All @@ -97,20 +97,22 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.59.2)
rubocop (0.67.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
psych (>= 3.1.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
ruby-progressbar (1.10.0)
sqlite3 (1.3.13)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
unicode-display_width (1.5.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand All @@ -130,9 +132,10 @@ DEPENDENCIES
rectify!
rspec (~> 3.8)
rspec-collection_matchers (~> 1.1)
rubocop
rubocop (~> 0.67.2)
rubocop-performance
sqlite3
wisper-rspec

BUNDLED WITH
1.16.2
1.17.2
2 changes: 0 additions & 2 deletions lib/rectify/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ def initialize
@events = {}
end

# rubocop:disable Style/MethodMissing
def method_missing(method_name, *args, &_block)
args = args.first if args.size == 1
@events[method_name] = args
end
# rubocop:enable Style/MethodMissing

def respond_to_missing?(_method_name, _include_private = false)
true
Expand Down
2 changes: 1 addition & 1 deletion lib/rectify/rspec/database_reporter/reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DatabaseReporter
^SAVEPOINT|
^SHOW|
^PRAGMA
/xi
/xi.freeze

def self.enable
::RSpec.configure do |config|
Expand Down
3 changes: 2 additions & 1 deletion rectify.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake"
s.add_development_dependency "rspec", "~> 3.8"
s.add_development_dependency "rspec-collection_matchers", "~> 1.1"
s.add_development_dependency "rubocop"
s.add_development_dependency "rubocop", "~> 0.67.2"
s.add_development_dependency "rubocop-performance"
s.add_development_dependency "sqlite3"
end
6 changes: 3 additions & 3 deletions spec/lib/rectify/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
events = ReturnMultiEventMultiResultCommand.call

expect(events).to eq(
:ok => [1, 2, 3],
:ok => [1, 2, 3],
:published => "The command works",
:next => []
:next => []
)
end
end
Expand Down Expand Up @@ -56,7 +56,7 @@ def something_private
@private = true
end

private :something_private
private :something_private # rubocop:disable Style/AccessModifierDeclarations

it "calls public methods on the caller" do
@success = false
Expand Down
74 changes: 37 additions & 37 deletions spec/lib/rectify/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38
)
Expand All @@ -18,7 +18,7 @@
form = UserForm.new(:user => "andy38", :first_name => "Andy", :age => 38)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38
)
Expand All @@ -28,18 +28,18 @@
describe ".from_params" do
let(:params) do
ActionController::Parameters.new(
"id" => "1",
"id" => "1",
"other_id" => "2",
"user" => {
"user" => "andy38",
"user" => "andy38",
"first_name" => "Andy",
"age" => "38",
"colours" => %w[red blue green],
"file" => ActionDispatch::Http::UploadedFile.new(:tempfile => Tempfile.new("file")),
"age" => "38",
"colours" => %w[red blue green],
"file" => ActionDispatch::Http::UploadedFile.new(:tempfile => Tempfile.new("file")),
"address" => {
"street" => "1 High Street",
"town" => "Wimbledon",
"city" => "London",
"street" => "1 High Street",
"town" => "Wimbledon",
"city" => "London",
"post_code" => "SW19 1AB"
},
"contacts" => [
Expand All @@ -55,10 +55,10 @@
form = UserForm.from_params(params)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38,
:colours => %w[red blue green]
:age => 38,
:colours => %w[red blue green]
)
end

Expand All @@ -78,9 +78,9 @@
form = UserForm.from_params(params)

expect(form.address).to have_attributes(
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:post_code => "SW19 1AB"
)
end
Expand Down Expand Up @@ -169,10 +169,10 @@
form = ChildForm.from_params(params)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38,
:school => "Rutlish"
:age => 38,
:school => "Rutlish"
)
end

Expand Down Expand Up @@ -200,16 +200,16 @@
describe ".from_model" do
let(:model) do
User.new(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38,
:contacts => [
:age => 38,
:contacts => [
Contact.new(:name => "James", :number => "12345")
],
:address => Address.new(
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:post_code => "SW19 1AB"
),
:last_logged_in => Time.new(2016, 1, 30, 9, 30, 0)
Expand All @@ -220,7 +220,7 @@
form = UserForm.from_model(model)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38
)
Expand All @@ -231,7 +231,7 @@

expect(form.contacts).to have(1).item
expect(form.contacts.first).to have_attributes(
:name => "James",
:name => "James",
:number => "12345"
)
end
Expand All @@ -240,9 +240,9 @@
form = UserForm.from_model(model)

expect(form.address).to have_attributes(
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:street => "1 High Street",
:town => "Wimbledon",
:city => "London",
:post_code => "SW19 1AB"
)
end
Expand Down Expand Up @@ -273,7 +273,7 @@
form = UserForm.from_json(json)

expect(form).to have_attributes(
:user => "andy38",
:user => "andy38",
:first_name => "Andy",
:age => 38
)
Expand Down Expand Up @@ -357,14 +357,14 @@
describe "#attributes_with_values" do
it "returns a hash of attributes where their values are non-nil" do
form = AddressForm.new(
:id => 1,
:street => "1 High Street",
:town => nil,
:id => 1,
:street => "1 High Street",
:town => nil,
:post_code => "GU1 2AB"
)

expect(form.attributes_with_values).to eq(
:street => "1 High Street",
:street => "1 High Street",
:post_code => "GU1 2AB"
)
end
Expand Down Expand Up @@ -483,7 +483,7 @@
it "returns true" do
form = UserForm.new(
:first_name => "Andy",
:contacts => [ContactForm.new(:name => "Andy")]
:contacts => [ContactForm.new(:name => "Andy")]
)

expect(form).to be_valid
Expand Down Expand Up @@ -549,7 +549,7 @@
it "assigns a context to array attribute child forms" do
form = UserForm.new(
:first_name => "Andy",
:contacts => [ContactForm.new(:name => "Andy")]
:contacts => [ContactForm.new(:name => "Andy")]
).with_context(:account_id => 1)

expect(form.contacts.first.context.account_id).to eq(1)
Expand Down