Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

symbolize Configuration ignore groups on read

  • Loading branch information...
commit e71f2975936e74f40a72108a389d79c4777fe5a8 1 parent e39cb2d
Matthew Kane Parker and Rob Gallagher authored
View
4 lib/license_finder/configuration.rb
@@ -1,5 +1,9 @@
module LicenseFinder
class Configuration < LicenseFinder::Persistence::Configuration
+ def ignore_groups
+ super.map &:to_sym
+ end
+
def whitelisted?(license_name)
license = License.find_by_name(license_name) || license_name
whitelisted_licenses.include? license
View
15 spec/lib/license_finder/configuration_spec.rb
@@ -3,9 +3,9 @@
describe LicenseFinder::Configuration do
it_behaves_like "a persistable configuration"
- describe "whitelisted?" do
- let(:config) { LicenseFinder::Configuration.new }
+ let(:config) { LicenseFinder::Configuration.new }
+ describe "whitelisted?" do
context "canonical name whitelisted" do
before { config.whitelist = [LicenseFinder::License::Apache2.names[rand(0...LicenseFinder::License::Apache2.names.count)]]}
@@ -24,4 +24,15 @@
end
end
end
+
+ describe "#ignore_groups" do
+ it "should default to an empty array" do
+ config.ignore_groups.should == []
+ end
+
+ it "should always return symbolized versions of the ignore groups" do
+ config.ignore_groups = %w[test development]
+ config.ignore_groups.should == [:test, :development]
+ end
+ end
end
View
6 spec/support/shared_examples/persistence/configuration.rb
@@ -25,10 +25,4 @@
klass.new.whitelist.should == []
end
end
-
- describe "#ignore_groups" do
- it "should default to an empty array" do
- klass.new.ignore_groups.should == []
- end
- end
end
Please sign in to comment.
Something went wrong with that request. Please try again.