Permalink
Browse files

Fixed specs.

  • Loading branch information...
1 parent e1e5de5 commit 4b3d5f18478297db103ad61430f5f90b33409255 @postmodern committed Jun 24, 2011
Showing with 2 additions and 9 deletions.
  1. +1 −1 lib/warnings/mixin.rb
  2. +1 −1 lib/warnings/warning.rb
  3. +0 −7 spec/warning_spec.rb
View
2 lib/warnings/mixin.rb
@@ -27,7 +27,7 @@ def warnings=(mode)
# enable all warnings by default.
#
def warnings?
- ($VERBOSE || $DEBUG) || (@warnings == true)
+ ($VERBOSE || $DEBUG) || (@warnings != false)
end
#
View
2 lib/warnings/warning.rb
@@ -41,7 +41,7 @@ def initialize(message,backtrace)
file, line, context = @backtrace.first.split(':',3)
@source_location = [file, line.to_i]
- @source_method = context[4..-2] if context
+ @source_method = context[5..-2] if context
end
#
View
7 spec/warning_spec.rb
@@ -28,13 +28,6 @@
subject.source_location.should be == [source_file, source_line]
end
- it "should format the warning" do
- formatted = subject.format
-
- formatted.should include(subject.message)
- formatted.should include("#{source_file}:#{source_line}")
- end
-
it "should provide a #to_s method" do
subject.to_s.should be == subject.message
end

0 comments on commit 4b3d5f1

Please sign in to comment.