Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added tests for the negative conditions

git-svn-id: https://svn.thoughtbot.com/plugins/what@363 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
commit d111e93cfb115999985c63f2a5a95299f87542c9 1 parent e269f3d
jcarroll authored
Showing with 9 additions and 7 deletions.
  1. +1 −2  init.rb
  2. +0 −1  install.rb
  3. +8 −3 test/what_test.rb
  4. +0 −1  uninstall.rb
View
3  init.rb
@@ -1,3 +1,2 @@
-require File.join(File.dirname(__FILE__), 'lib', 'what')
-
+require 'what'
View
1  install.rb
@@ -1 +0,0 @@
-# Install hook code here
View
11 test/what_test.rb
@@ -10,9 +10,14 @@ def setup
Mime::Type.register 'image/png', :png
end
- Mime::SET.each do |each|
- define_method "test_should_say_its_a_#{each.to_sym}_mime_type_when_sent_#{each.to_sym}?" do
- assert each.send("#{each.to_sym}?")
+ Mime::SET.each do |mime_type|
+ define_method "test_should_say_its_a_#{mime_type.to_sym}_mime_type_when_sent_#{mime_type.to_sym}?" do
+ assert mime_type.send("#{mime_type.to_sym}?")
+ end
+
+ other_mime_type = Mime::SET.detect {|each| each != mime_type}
+ define_method "test_should_not_say_its_a_#{other_mime_type.to_sym}_mime_type_if_its_not_one_when_sent_#{other_mime_type.to_sym}?" do
+ assert ! mime_type.send("#{other_mime_type.to_sym}?")
end
end
View
1  uninstall.rb
@@ -1 +0,0 @@
-# Uninstall hook code here
Please sign in to comment.
Something went wrong with that request. Please try again.