Skip to content

Commit

Permalink
Fixing steam_id universe always returning true for developer universe
Browse files Browse the repository at this point in the history
  • Loading branch information
reu committed Feb 4, 2012
1 parent 7bc8ef0 commit d9e0289
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fonte/nodes/steam_id_universe_node.rb
Expand Up @@ -35,7 +35,7 @@ def internal?
end

def developer?
value = "Dev"
value == "Dev"
end

def rc?
Expand Down
30 changes: 30 additions & 0 deletions spec/parsers/steam_id_parser_spec.rb
Expand Up @@ -86,41 +86,71 @@ module Parsers
let(:steam_id) { "STEAM_0:1:24968171" }

it { should be_unspecified }
it { should_not be_public }
it { should_not be_beta }
it { should_not be_internal }
it { should_not be_developer }
it { should_not be_rc }
its(:value) { should == "Unspecified" }
end

context "STEAM_1" do
let(:steam_id) { "STEAM_1:1:24968171" }

it { should be_public }
it { should_not be_unspecified }
it { should_not be_beta }
it { should_not be_internal }
it { should_not be_developer }
it { should_not be_rc }
its(:value) { should == "Public" }
end

context "STEAM_2" do
let(:steam_id) { "STEAM_2:1:24968171" }

it { should be_beta }
it { should_not be_unspecified }
it { should_not be_public }
it { should_not be_internal }
it { should_not be_developer }
it { should_not be_rc }
its(:value) { should == "Beta" }
end

context "STEAM_3" do
let(:steam_id) { "STEAM_3:1:24968171" }

it { should be_internal }
it { should_not be_unspecified }
it { should_not be_public }
it { should_not be_beta }
it { should_not be_developer }
it { should_not be_rc }
its(:value) { should == "Internal" }
end

context "STEAM_4" do
let(:steam_id) { "STEAM_4:1:24968171" }

it { should be_developer }
it { should_not be_unspecified }
it { should_not be_public }
it { should_not be_beta }
it { should_not be_internal }
it { should_not be_rc }
its(:value) { should == "Dev" }
end

context "STEAM_5" do
let(:steam_id) { "STEAM_5:1:24968171" }

it { should be_rc }
it { should_not be_unspecified }
it { should_not be_public }
it { should_not be_beta }
it { should_not be_internal }
it { should_not be_developer }
its(:value) { should == "RC" }
end
end
Expand Down

0 comments on commit d9e0289

Please sign in to comment.