Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
3  Gemfile.lock
@@ -237,6 +237,8 @@ GEM
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
+ rspec-given (1.5.0)
+ rspec (> 1.2.8)
rspec-mocks (2.7.0)
rspec-on-rails-matchers (1.0.0)
rspec-rails (2.7.0)
@@ -311,6 +313,7 @@ DEPENDENCIES
mocha
rake
rspec (>= 2.0.0)
+ rspec-given
rspec-on-rails-matchers
rspec-rails (>= 2.0.0)
ruby-debug
View
1  atrium.gemspec
@@ -63,6 +63,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'ruby-debug-base'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'rspec-on-rails-matchers'
+ s.add_development_dependency 'rspec-given'
s.add_development_dependency 'guard'
s.add_development_dependency 'guard-rspec'
s.add_development_dependency 'ruby_gntp' if RUBY_PLATFORM =~ /darwin/
View
14 test_support/spec/models/atrium/browse_level_spec.rb
@@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Atrium::BrowseLevel do
+ Given (:browse_level) { Atrium::BrowseLevel.new }
it { should belong_to :exhibit }
@@ -17,17 +18,14 @@
it { should respond_to :selected }
it { should respond_to :selected= }
- describe '#values' do
- it 'should be enumerable' do
- Atrium::BrowseLevel.new.values.should be_kind_of Enumerable
- end
+ context '#values' do
+ Then { browse_level.values.should be_kind_of Enumerable }
end
describe '#to_s' do
- it 'should be #solr_facet_name' do
- string = "Hello"
- Atrium::BrowseLevel.new(:solr_facet_name => string).to_s.should == string
- end
+ Given(:comparison_string) { 'Hello'}
+ When { browse_level.solr_facet_name = comparison_string }
+ Then { browse_level.to_s.should == comparison_string }
end
end
View
30 test_support/spec/models/atrium/collection_spec.rb
@@ -1,30 +1,30 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe Atrium::Collection do
+ Given(:collection) { Atrium::Collection.new }
it { should have_many :showcases }
it { should have_many :search_facets }
it { should have_many :exhibits }
- describe "#theme_path" do
- it 'should default to "atrium_themes/default"' do
- subject.theme_path.should == "atrium_themes/default"
+ context "#theme_path" do
+ context 'default value' do
+ Then { collection.theme_path.should == "atrium_themes/default" }
end
- it 'should be updatable' do
- theme_name = 'chunky_bacon'
- subject.theme = theme_name
- subject.theme_path.should == "atrium_themes/#{theme_name}"
+ context 'set value' do
+ Given(:theme_name) { 'chunky_bacon' }
+ When { collection.theme = theme_name }
+ Then { collection.theme_path.should == "atrium_themes/#{theme_name}" }
end
end
- describe "#display_title" do
- it "should default to 'Unnamed Collection'" do
- subject.display_title.should == "<h2>#{subject.pretty_title}</h2>"
+ context "#display_title" do
+ context 'default value' do
+ Then { collection.display_title.should == "<h2>#{subject.pretty_title}</h2>" }
end
-
- it "should use #title_markup when set" do
- string = '<h2>Saving <em>the World</em></h2>'
- subject.title_markup = string
- subject.display_title.should == string
+ context 'set value' do
+ Given(:title_markup_to_use) { '<h2>Saving <em>the World</em></h2>' }
+ When { collection.title_markup = title_markup_to_use }
+ Then { collection.display_title.should == title_markup_to_use }
end
end
end
View
1  test_support/spec/spec_helper.rb
@@ -10,6 +10,7 @@
# in a remote directory.
require File.expand_path("config/environment", ENV['RAILS_ROOT'] || File.expand_path("../../../tmp/test_app", __FILE__))
require 'rspec/rails'
+require 'rspec/given'
require 'rspec_on_rails_matchers'
# Requires supporting ruby files with custom matchers and macros, etc,

No commit comments for this range

Something went wrong with that request. Please try again.