Skip to content

Commit

Permalink
- try using rspec+insist
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Mar 8, 2012
1 parent 67e730d commit a7468be
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 111 deletions.
6 changes: 0 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
source :rubygems

gemspec

group :development do
gem "guard"
gem "guard-minitest"
gem "guard-shell"
end
28 changes: 16 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,42 @@ PATH
remote: .
specs:
fpm (0.4.0)
arr-pm
backports (= 2.3.0)
cabin (~> 0.4.2)
json

GEM
remote: http://rubygems.org/
specs:
arr-pm (0.0.2)
cabin (> 0)
backports (2.3.0)
cabin (0.4.2)
json
diff-lcs (1.1.3)
fattr (2.2.1)
ffi (1.0.11)
guard (1.0.0)
ffi (>= 0.5.0)
thor (~> 0.14.6)
guard-minitest (0.3.0)
guard (>= 0.2.2)
guard-shell (0.3.0)
guard (>= 0.2.0)
insist (0.0.1)
cabin (> 0)
json (1.6.5)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
rush (0.6.7)
session
session (3.1.0)
fattr
thor (0.14.6)

PLATFORMS
ruby

DEPENDENCIES
fpm!
guard
guard-minitest
guard-shell
insist
rspec
rush
3 changes: 3 additions & 0 deletions fpm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Gem::Specification.new do |spec|
# http://rush.heroku.com/rdoc/
spec.add_development_dependency("rush") # license: MIT

spec.add_development_dependency("rspec") # license: ???
spec.add_development_dependency("insist") # license: ???

spec.files = files
spec.require_paths << "lib"
spec.bindir = "bin"
Expand Down
38 changes: 38 additions & 0 deletions spec/fpm/package/rpm_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require "spec_setup"
require "fpm" # local
require "fpm/package/rpm" # local
require "fpm/package/dir" # local
require "rpm" # gem arr-pm

describe FPM::Package::RPM do
subject { FPM::Package::RPM.new }

before :each do
@target = Tempfile.new
end # before

after :each do
subject.cleanup
@target.close
end # after

describe "#output" do
context "basics" do
before :each do

end

it "should output a package with the correct name" do
subject.output(@target.path)
rpm = RPM::File.new(@target.path)
# TODO(sissel): verify rpm name vs subject.name

end

it "should output a package with the correct version"
it "should output a package with the correct iteration"
it "should output a package with the correct epoch"
it "should output a package with the correct dependencies"
end

end # describe FPM::Package::Dir
29 changes: 29 additions & 0 deletions spec/fpm/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,33 @@
insist { subject.name } == name
end
end

describe "#version" do
it "should default to '1.0'" do
insist { subject.version } == "1.0"
end

it "should allow setting the package name" do
version = "hello"
subject.version = version
insist { subject.version } == version
end
end

describe "#architecture"
describe "#attributes"
describe "#category"
describe "#config_files"
describe "#conflicts"
describe "#dependencies"
describe "#description"
describe "#epoch"
describe "#iteration"
describe "#license"
describe "#maintainer"
describe "#provides"
describe "#replaces"
describe "#scripts"
describe "#url"
describe "#vendor"
end # describe FPM::Package
93 changes: 0 additions & 93 deletions test/fpm/package/dir.rb

This file was deleted.

0 comments on commit a7468be

Please sign in to comment.