Re-implemented all development Rake tasks in Thor. Now actually tested.
Fixes: * https://www.pivotaltracker.com/story/show/25484287 & https://github.com/pivotal/jasmine/issues/183 * https://www.pivotaltracker.com/story/show/25485401 & https://github.com/pivotal/jasmine/issues/189 * https://www.pivotaltracker.com/story/show/25485953 & https://github.com/pivotal/jasmine/issues/159
This commit is contained in:
55
spec/tasks/version_spec.rb
Normal file
55
spec/tasks/version_spec.rb
Normal file
@@ -0,0 +1,55 @@
|
||||
require 'spec_helper.rb'
|
||||
|
||||
describe "Version tasks" do
|
||||
|
||||
let(:jasmine_dev) { JasmineDev.new }
|
||||
|
||||
describe "write_version_files" do
|
||||
|
||||
before do
|
||||
@output = capture_output { jasmine_dev.write_version_files }
|
||||
end
|
||||
|
||||
it "should tell the user that the task has started" do
|
||||
@output.should match(/Building version files/)
|
||||
end
|
||||
|
||||
it "should build the version.js file" do
|
||||
js_version = File.read(File.join(project_root, 'src', 'version.js'))
|
||||
js_version.should match(%Q{"build": #{jasmine_version_object["build"]}})
|
||||
js_version.should match(%Q{"minor": #{jasmine_version_object["minor"]}})
|
||||
js_version.should match(%Q{"build": #{jasmine_version_object["build"]}})
|
||||
|
||||
if jasmine_version_object["release_candidate"]
|
||||
js_version.should match(%Q{"rc:" #{jasmine_version_object["release_candidate"]}})
|
||||
end
|
||||
|
||||
js_version.should match(/"revision": \d+/)
|
||||
end
|
||||
|
||||
it "should build the jasmine-core ruby gem version" do
|
||||
ruby_version = File.read(File.join(project_root, 'lib', 'jasmine-core', 'version.rb'))
|
||||
ruby_version.should match(%Q{VERSION = "#{jasmine_version}"})
|
||||
end
|
||||
end
|
||||
|
||||
describe "display_version" do
|
||||
describe "when Node.js is not present" do
|
||||
before do
|
||||
@output = capture_output { jasmine_dev.display_version }
|
||||
end
|
||||
|
||||
it "should display a version header" do
|
||||
@output.should match(/Current version/)
|
||||
end
|
||||
|
||||
it "should display the current version Object" do
|
||||
@output.should match(/Display version: \e\[33m\d+\.\d+\.\d+/)
|
||||
end
|
||||
|
||||
it "should display the current version string" do
|
||||
@output.should match(/\{ "major": \d+, "minor": \d+, "build": \d+/)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user