Skip to content
This repository
Browse code

Enable Ruby warnings for tests and fix them

  • Loading branch information...
commit 0789ea2bac0d69680843e6d71fc1ac625e6131b4 1 parent e6a9575
Peter Brown authored February 09, 2013
5  Rakefile
@@ -2,5 +2,8 @@
2 2
 require "bundler/gem_tasks"
3 3
 require 'rspec/core/rake_task'
4 4
 
5  
-RSpec::Core::RakeTask.new(:spec)
  5
+RSpec::Core::RakeTask.new(:spec) do |t|
  6
+  t.ruby_opts = "-w"
  7
+end
  8
+
6 9
 task :default => :spec
1  lib/classy_enum/base.rb
@@ -67,6 +67,7 @@ def build(value, options={})
67 67
           # Subclass the base class and make it behave like the value that it is
68 68
           object = Class.new(base_class) {
69 69
             instance_variable_set(:@option, value)
  70
+            instance_variable_set(:@index, 0)
70 71
             delegate :blank?, :nil?, :to => :option
71 72
           }.new
72 73
         end
4  spec/classy_enum_inheritance_spec.rb
@@ -14,8 +14,8 @@ class ProjectTier::Two < ProjectTier::One
14 14
 
15 15
 describe 'Classy Enum inheritance' do
16 16
   it 'should inherit from the previous class' do
17  
-    ProjectTier::One.inherited_properties.should == [1,2,3]
18  
-    ProjectTier::Two.inherited_properties.should == [1,2,3,4,5,6]
  17
+    ProjectTier::One.inherited_properties.should eql([1,2,3])
  18
+    ProjectTier::Two.inherited_properties.should eql([1,2,3,4,5,6])
19 19
   end
20 20
 
21 21
   it 'should instantiate the subclass' do

0 notes on commit 0789ea2

Please sign in to comment.
Something went wrong with that request. Please try again.