Skip to content

Commit

Permalink
Specify VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
cgriego committed Oct 2, 2011
1 parent cf64d05 commit bb173a5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions spec/active_attr/version_spec.rb
@@ -0,0 +1,35 @@
require "spec_helper"
require "active_attr/version"

module ActiveAttr
describe "ActiveAttr::VERSION" do
subject { VERSION }

it { should be_a_kind_of String }

describe "is compliant with Semantic Versioning <http://semver.org/>" do
let(:gem_version) { Gem::Version.new VERSION }
subject { gem_version }

it { subject.should have(3).segments }

describe "major version" do
subject { gem_version.segments[0] }

it { should be_a_kind_of Fixnum }
end

describe "minor version" do
subject { gem_version.segments[1] }

it { should be_a_kind_of Fixnum }
end

describe "patch version" do
subject { gem_version.segments[2] }

it { subject.to_s.should =~ /\d+([A-Za-z][0-9A-Za-z-]*)?/ }
end
end
end
end

0 comments on commit bb173a5

Please sign in to comment.