-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add options to customize generated gemfiles (#191)
- Loading branch information
Showing
6 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Appraisal | ||
class Customize | ||
def initialize(heading: nil, single_quotes: false) | ||
@@heading = heading | ||
@@single_quotes = single_quotes | ||
end | ||
|
||
def self.heading | ||
@@heading ||= nil | ||
end | ||
|
||
def self.single_quotes | ||
@@single_quotes ||= false | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "spec_helper" | ||
require "appraisal/customize" | ||
|
||
describe Appraisal::Customize do | ||
it "has defaults" do | ||
expect(described_class.heading).to eq nil | ||
expect(described_class.single_quotes).to eq false | ||
expect { described_class.new }.to_not(change do | ||
[described_class.heading, described_class.single_quotes] | ||
end) | ||
end | ||
|
||
it "can override defaults" do | ||
described_class.new(single_quotes: true, heading: "foo") | ||
expect(described_class.heading).to eq "foo" | ||
expect(described_class.single_quotes).to eq true | ||
end | ||
end |