Spec: rename local to noun
This commit is contained in:
parent
a997d2417d
commit
0b32484184
|
@ -2,17 +2,17 @@ describe GitHubChangelogGenerator::ParserFile do
|
||||||
describe ".github_changelog_generator" do
|
describe ".github_changelog_generator" do
|
||||||
context "when no has file" do
|
context "when no has file" do
|
||||||
let(:options) { {} }
|
let(:options) { {} }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||||
subject { parse.parse! }
|
subject { parser.parse! }
|
||||||
it { is_expected.to be_nil }
|
it { is_expected.to be_nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when file is empty" do
|
context "when file is empty" do
|
||||||
let(:options) { {} }
|
let(:options) { {} }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options, StringIO.new("")) }
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options, StringIO.new("")) }
|
||||||
|
|
||||||
it "does not change the options" do
|
it "does not change the options" do
|
||||||
expect { parse.parse! }.to_not change { options }
|
expect { parser.parse! }.to_not change { options }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,10 +20,10 @@ describe GitHubChangelogGenerator::ParserFile do
|
||||||
let(:options) { {} }
|
let(:options) { {} }
|
||||||
let(:options_before_change) { options.dup }
|
let(:options_before_change) { options.dup }
|
||||||
let(:file) { StringIO.new("unreleased_label=staging\nunreleased: false") }
|
let(:file) { StringIO.new("unreleased_label=staging\nunreleased: false") }
|
||||||
let(:parse) do
|
let(:parser) do
|
||||||
GitHubChangelogGenerator::ParserFile.new(options, file)
|
GitHubChangelogGenerator::ParserFile.new(options, file)
|
||||||
end
|
end
|
||||||
it { expect { parse.parse! }.to raise_error(/line #2/) }
|
it { expect { parser.parse! }.to raise_error(/line #2/) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when override default values" do
|
context "when override default values" do
|
||||||
|
@ -31,10 +31,10 @@ describe GitHubChangelogGenerator::ParserFile do
|
||||||
let(:options) { {}.merge(default_options) }
|
let(:options) { {}.merge(default_options) }
|
||||||
let(:options_before_change) { options.dup }
|
let(:options_before_change) { options.dup }
|
||||||
let(:file) { StringIO.new("unreleased_label=staging\nunreleased=false\nheader==== Changelog ===") }
|
let(:file) { StringIO.new("unreleased_label=staging\nunreleased=false\nheader==== Changelog ===") }
|
||||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options, file) }
|
let(:parser) { GitHubChangelogGenerator::ParserFile.new(options, file) }
|
||||||
|
|
||||||
it "changes the options" do
|
it "changes the options" do
|
||||||
expect { parse.parse! }.to change { options }
|
expect { parser.parse! }.to change { options }
|
||||||
.from(options_before_change)
|
.from(options_before_change)
|
||||||
.to(options_before_change.merge(unreleased_label: "staging",
|
.to(options_before_change.merge(unreleased_label: "staging",
|
||||||
unreleased: false,
|
unreleased: false,
|
||||||
|
@ -50,13 +50,13 @@ EOF
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
it "reads exclude_labels into an Array" do
|
it "reads exclude_labels into an Array" do
|
||||||
expect { parse.parse! }.to change { options[:exclude_labels] }
|
expect { parser.parse! }.to change { options[:exclude_labels] }
|
||||||
.from(default_options[:exclude_labels])
|
.from(default_options[:exclude_labels])
|
||||||
.to(["73a91042-da6f-11e5-9335-1040f38d7f90", "7adf83b4-da6f-11e5-ae18-1040f38d7f90"])
|
.to(["73a91042-da6f-11e5-9335-1040f38d7f90", "7adf83b4-da6f-11e5-ae18-1040f38d7f90"])
|
||||||
end
|
end
|
||||||
|
|
||||||
it "translates given header_label into the :header option" do
|
it "translates given header_label into the :header option" do
|
||||||
expect { parse.parse! }.to change { options[:header] }
|
expect { parser.parse! }.to change { options[:header] }
|
||||||
.from(default_options[:header])
|
.from(default_options[:header])
|
||||||
.to("# My changelog")
|
.to("# My changelog")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user