This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

LH-629 Ensure notifier is not considered a framework gem

  • Loading branch information...
1 parent d6376fc commit 390df9b265e720608d64603aacb8674b2afcf9a5 @jasonm jasonm committed Mar 10, 2010
View
@@ -83,3 +83,11 @@ Feature: Install the Gem in a Rails application
| session | value: test |
| parameters | param: value |
| url | http://example.com:123/test/index?param=value |
+
+ Scenario: The gem should not be considered a framework gem
+ When I generate a new Rails application
+ And I configure the Hoptoad shim
+ And I configure my application to require the "hoptoad_notifier" gem
+ And I run "script/generate hoptoad -k myapikey"
+ And I run "rake gems"
+ Then I should see that "hoptoad_notifier" is not considered a framework gem
@@ -97,6 +97,12 @@
end
end
+Then /^I should not see "([^\"]*)"$/ do |unexpected_text|
+ if @terminal.output.include?(unexpected_text)
+ raise("Got terminal output:\n#{@terminal.output}\n\nDid not expect the following output:\n#{unexpected_text}")
+ end
+end
+
When /^I uninstall the "([^\"]*)" gem$/ do |gem_name|
@terminal.uninstall_gem(gem_name)
end
@@ -202,3 +208,6 @@ def initialize(*args)
Then %{I should see "[Rails: #{rails_version}]"}
end
+Then /^I should see that "([^\"]*)" is not considered a framework gem$/ do |gem_name|
+ Then %{I should not see "[R] #{gem_name}"}
+end
@@ -1,5 +1,12 @@
-Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
- $: << File.join(vendored_notifier, 'lib')
-end
+# Don't load anything when running the gems:* tasks.
+# Otherwise, hoptoad_notifier will be considered a framework gem.
+# https://thoughtbot.lighthouseapp.com/projects/14221/tickets/629
+unless ARGV.any? {|a| a =~ /^gems/}
+
+ Dir[File.join(RAILS_ROOT, 'vendor', 'gems', 'hoptoad_notifier-*')].each do |vendored_notifier|
+ $: << File.join(vendored_notifier, 'lib')
+ end
-require 'hoptoad_notifier/tasks'
+ require 'hoptoad_notifier/tasks'
+
+end

0 comments on commit 390df9b

Please sign in to comment.