Skip to content

Instantly share code, notes, and snippets.

@benlovell
Last active December 16, 2015 20:09
Show Gist options
  • Save benlovell/5490267 to your computer and use it in GitHub Desktop.
Save benlovell/5490267 to your computer and use it in GitHub Desktop.
require "dm-core"
require "dm-timestamps"
class Item
include DataMapper::Resource
property :id, Serial
property :title, String
property :category, String
property :completed, Boolean
end
require "spec_helper"
describe Item do
it { should have_property :id }
it { should have_property :title }
it { should have_property :category }
it { should have_property :completed }
it "starts as incomplete"
it "can be completed"
end
*FFF*F
Pending:
Item can be completed
# Not yet implemented
# ./spec/models/item_spec.rb:11
Item starts as incomplete
# Not yet implemented
# ./spec/models/item_spec.rb:9
Failures:
1) Item
Failure/Error: it { should have_property :title }
NoMethodError:
undefined method `has_property?' for #<Item @id=nil @title=nil @category=nil @completed=nil>
# ./spec/models/item_spec.rb:5:in `block (2 levels) in <top (required)>'
2) Item
Failure/Error: it { should have_property :id }
NoMethodError:
undefined method `has_property?' for #<Item @id=nil @title=nil @category=nil @completed=nil>
# ./spec/models/item_spec.rb:4:in `block (2 levels) in <top (required)>'
3) Item
Failure/Error: it { should have_property :category }
NoMethodError:
undefined method `has_property?' for #<Item @id=nil @title=nil @category=nil @completed=nil>
# ./spec/models/item_spec.rb:6:in `block (2 levels) in <top (required)>'
4) Item
Failure/Error: it { should have_property :completed }
NoMethodError:
undefined method `has_property?' for #<Item @id=nil @title=nil @category=nil @completed=nil>
# ./spec/models/item_spec.rb:7:in `block (2 levels) in <top (required)>'
Finished in 0.00216 seconds
6 examples, 4 failures, 2 pending
Failed examples:
rspec ./spec/models/item_spec.rb:5 # Item
rspec ./spec/models/item_spec.rb:4 # Item
rspec ./spec/models/item_spec.rb:6 # Item
rspec ./spec/models/item_spec.rb:7 # Item
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..")
# raise $LOAD_PATH.inspect
require "my_leisure_list"
require "dm-rspec"
# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
config.include(DataMapper::Matchers)
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = 'random'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment