Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
fix 3 rubocop errors
Browse files Browse the repository at this point in the history
Changes are purely for style purposes in accordance to rubocop.yml
settings. These four changes now permit a git commit without skipping
via SKIP=RuboCop.

JacobEvelyn#78
  • Loading branch information
codyjroberts committed Jan 16, 2016
1 parent 00f82d3 commit e683111
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/friends/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class Activity

# @return [Regexp] the regex for capturing groups in deserialization
def self.deserialization_regex
/(#{SERIALIZATION_PREFIX})?((?<date_s>\d{4}-\d\d-\d\d)(:\s)?)?(?<description>.+)?/
%r{
(#{SERIALIZATION_PREFIX})?
((?<date_s>\d{4}-\d\d-\d\d)(:\s)?)?
(?<description>.+)?
}x
end

# @return [Regexp] the string of what we expected during deserialization
Expand Down
6 changes: 5 additions & 1 deletion lib/friends/friend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ class Friend

# @return [Regexp] the regex for capturing groups in deserialization
def self.deserialization_regex
/(#{SERIALIZATION_PREFIX})?(?<name>[^\(]+)(\((?<nickname_str>#{NICKNAME_PREFIX}.+)\))?/
%r{
(#{SERIALIZATION_PREFIX})?
(?<name>[^\(]+)
(\((?<nickname_str>#{NICKNAME_PREFIX}.+)\))?
}x
end

# @return [Regexp] the string of what we expected during deserialization
Expand Down
9 changes: 6 additions & 3 deletions test/introvert_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

describe Friends::Introvert do
# Add readers to make internal state easier to test.
class Friends::Introvert
attr_reader :filename, :activities, :friends
module Friends
class Introvert
attr_reader :filename, :activities, :friends
end
end

# Add helpers to set internal states for friends and activities.
Expand Down Expand Up @@ -318,7 +320,8 @@ def stub_activities(val)
after { File.delete(filename) if File.exists?(filename) }

it "returns the modified friend" do
friend = Friends::Friend.new(name: "Jeff", nickname_str: "a.k.a. The Dude")
friend = Friends::Friend.new(name: "Jeff",
nickname_str: "a.k.a. The Dude")
stub_friends([friend]) do
subject.must_equal friend
end
Expand Down

0 comments on commit e683111

Please sign in to comment.