rshighscores 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 344d5fdf838f325840ce3656527d712edd3fb9c6
4
- data.tar.gz: b9fd1fe8d2f9a7b4cfc4eb6f8fd3025c672faf77
3
+ metadata.gz: 16a49fc6f1b6ed8498727f9049c63d84a6d880e6
4
+ data.tar.gz: 34abff3b83241879be64832f11cecde8ff197fb9
5
5
  SHA512:
6
- metadata.gz: c7464194e33cf7d901c109431d5d512f75dd20d989000a0b2939132d53647ffd5745416d3f47bd4980fdc492ff53efa0776be92ddf300a06c873370fb8e7d409
7
- data.tar.gz: ef9171b1468052ea74465737d1246f22f472d9fd35053bc4ccdbcec10de6b1c6c24a92621cd617dff9e793960884a53c9b8d89e5580790cb87d3843214cf7040
6
+ metadata.gz: b54eb879b6c9b8e95e676fb1fe398878fe174c2ca1c99821573ed8ab523232ff285d18bc3c238db6443d73bf668f87bda420af6689861b1687a9579d1f23fbb5
7
+ data.tar.gz: affa06907703a651865bd63b3bc2b931f1eb2de36612bd9049738af06819a41bf5d83a48fdd482b86f02f4b18183073e7543af7b33d19e3ddb30d25d8ad75f97
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new :test
5
5
 
6
- task :default => [:test]
6
+ task :default => [:test]
data/lib/rshighscores.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  end
4
4
 
5
5
  module RsHighscores
6
- VERSION = "2.0.0"
6
+ VERSION = "2.0.1"
7
7
  end
@@ -58,7 +58,8 @@ module RsHighscores
58
58
  end
59
59
 
60
60
  def method_missing name, *args
61
- return self[name] if @@skills.include? name.to_s
61
+ return self[name] if skill_names.include? name.to_s.capitalize
62
+ raise NoMethodError
62
63
  end
63
64
  end
64
65
  end
data/spec/lookup_spec.rb CHANGED
@@ -77,9 +77,25 @@ describe RsHighscores::Stats do
77
77
  end
78
78
  end
79
79
 
80
+ it "skill_names output" do
81
+ @stats.skill_names.should eq(%w(Overall Attack Defence Strength
82
+ Hitpoints Ranged Prayer Magic
83
+ Cooking Woodcutting Fletching Fishing
84
+ Firemaking Crafting Smithing Mining
85
+ Herblore Agility Thieving Slayer
86
+ Farming Runecrafting Hunter Construction
87
+ Summoning Dungeoneering Divination))
88
+ end
89
+
90
+ it "attempting to call a skill name that doesn't exist" do
91
+ lambda {
92
+ @stats.not_a_skill
93
+ }.should raise_error
94
+ end
95
+
80
96
  it "missing method call" do
81
97
  @stats.skill_names.each do |name|
82
- @stats.send(name.to_sym).should eq(@stats[name])
98
+ @stats.send(name.downcase).should eq(@stats[name])
83
99
  end
84
100
  end
85
101
  end
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,6 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  require 'rshighscores'
4
4
 
5
-
6
5
  RSpec.configure do |config|
7
6
  config.mock_with :rspec
8
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rshighscores
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Broughton