# jeweler generated
pkg
+# simplecov generated
+coverage
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
#
# * Create a file at ~/.gitignore
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
- gem "rspec", "~> 2.8.0"
- gem "bundler", "~> 1.0.0"
- gem "jeweler", "~> 1.8.0"
+ gem "rspec" # , "~> 2.8.0"
+ gem "bundler" # , "~> 1.0.0"
+ gem "jeweler" # , "~> 1.8.0"
+ gem 'simplecov', :require => false, :group => :test
end
specs:
diff-lcs (1.1.3)
git (1.2.5)
- jeweler (1.8.3)
+ jeweler (1.8.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
rdoc
- json (1.6.5)
+ json (1.7.3)
+ multi_json (1.3.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
- 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)
+ rspec (2.11.0)
+ rspec-core (~> 2.11.0)
+ rspec-expectations (~> 2.11.0)
+ rspec-mocks (~> 2.11.0)
+ rspec-core (2.11.0)
+ rspec-expectations (2.11.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.11.1)
+ simplecov (0.6.4)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
PLATFORMS
ruby
DEPENDENCIES
- bundler (~> 1.0.0)
- jeweler (~> 1.8.0)
- rspec (~> 2.8.0)
+ bundler
+ jeweler
+ rspec
+ simplecov
end
def to_s
- '<V: ' + self.name + '>'
+ '<V: ' + self.name.to_s + '>'
end
end
end
end # adds attributes
+ describe "#to_s" do
+ it "returns the string form of an edge" do
+ v1 = Vertex.new :name => :v1
+ v2 = Vertex.new :name => :v2
+ e.type = :test
+ e << v1 << v2
+ e.to_s.should == '<E: test [<V: v1>, <V: v2>] >'
+ end
+ end
+
describe "#<<" do
it "adds a new vertex to an edge (with a connection)" do
e.connections.should be_empty
v.score.should == 15
end
end # adds attributes
+
+ describe "#to_s" do
+ it "returns the string form of a vertex" do
+ v.name = :v1
+ v.to_s.should == '<V: v1>'
+ end
+ end
+
describe "#<<" do
it "adds a single edge between vertices" do
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'rspec'
-require 'graph.njae'
-
-# Requires supporting files with custom matchers and macros, etc,
-# in ./support/ and its subdirectories.
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
+require 'simplecov'
+SimpleCov.start
-RSpec.configure do |config|
-
-end
+require 'graph.njae'