Skip to content

Commit

Permalink
correct type check
Browse files Browse the repository at this point in the history
  • Loading branch information
plukevdh committed Jun 28, 2012
1 parent 1e7dc36 commit e476c9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/arturo.rb
Expand Up @@ -22,7 +22,7 @@ def feature_enabled_for?(feature_name, recipient)

def feature_enabled?(feature_name)
f = self::Feature.to_feature(feature_name)
method_missing :feature_enabled?, feature_name unless Arturo::GlobalFeature === f.class
method_missing :feature_enabled?, feature_name unless f.class == Arturo::GlobalFeature

f && f.enabled?
end
Expand Down
5 changes: 5 additions & 0 deletions test/dummy_app/test/unit/global_feature_test.rb
Expand Up @@ -13,6 +13,11 @@ def test_correct_class_name_used
assert_equal feature.class_name, "Arturo::GlobalFeature"
end

def test_responds_to_feature_enabled_helper
feature.enable!
assert ::Arturo.feature_enabled?(feature.symbol)
end

def test_to_feature_finds_global_feature
assert_equal feature, ::Arturo::Feature.to_feature(feature)
assert_equal feature, ::Arturo::Feature.to_feature(feature.symbol)
Expand Down

0 comments on commit e476c9b

Please sign in to comment.